Skip to content

Commit

Permalink
Merge pull request #95 from ethereumjs/update-dependencies
Browse files Browse the repository at this point in the history
Update outdated dependencies
  • Loading branch information
vpulim authored Feb 21, 2019
2 parents 22e5bd9 + dc747c4 commit ff1d68c
Show file tree
Hide file tree
Showing 43 changed files with 156 additions and 150 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sudo: false
os: linux
language: node_js
node_js:
- "8"
- "10"
- "11"
env:
- CXX=g++-4.8
addons:
Expand Down
2 changes: 1 addition & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const args = require('yargs')
})
.locale('en_EN')
.argv
const logger = getLogger({loglevel: args.loglevel})
const logger = getLogger({ loglevel: args.loglevel })

async function runNode (options) {
logger.info('Initializing Ethereumjs client...')
Expand Down
2 changes: 1 addition & 1 deletion browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports.util = require('../lib/util')
exports.logging = require('./logging')

exports.createNode = function (args) {
const logger = exports.logging.getLogger({loglevel: args.loglevel})
const logger = exports.logging.getLogger({ loglevel: args.loglevel })
const options = {
common: new Common(args.network || 'mainnet'),
servers: [new exports.Libp2pServer({ multiaddrs: [], ...args })],
Expand Down
2 changes: 1 addition & 1 deletion lib/blockchain/chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Chain extends EventEmitter {
*/
constructor (options) {
super()
options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }

this.logger = options.logger
this.common = options.common
Expand Down
2 changes: 1 addition & 1 deletion lib/net/peer/libp2ppeer.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Libp2pPeer extends Peer {
if (this.connected) {
return
}
const nodeInfo = await this.createPeerInfo({multiaddrs: ['/ip4/0.0.0.0/tcp/0']})
const nodeInfo = await this.createPeerInfo({ multiaddrs: ['/ip4/0.0.0.0/tcp/0'] })
const peerInfo = await this.createPeerInfo(this)
const node = new Libp2pNode({ peerInfo: nodeInfo })
await node.asyncStart()
Expand Down
2 changes: 1 addition & 1 deletion lib/net/peerpool.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PeerPool extends EventEmitter {
constructor (options) {
super()

options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }

this.servers = options.servers
this.logger = options.logger
Expand Down
2 changes: 1 addition & 1 deletion lib/net/protocol/ethprotocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const messages = [{
name: 'GetBlockHeaders',
code: 0x03,
response: 0x04,
encode: ({block, max, skip = 0, reverse = 0}) => [
encode: ({ block, max, skip = 0, reverse = 0 }) => [
BN.isBN(block) ? block.toArrayLike(Buffer) : block, max, skip, reverse
],
decode: ([block, max, skip, reverse]) => ({
Expand Down
2 changes: 1 addition & 1 deletion lib/net/protocol/flowcontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const defaultOptions = {
*/
class FlowControl {
constructor (options) {
options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }

this.bl = options.bl
this.mrc = options.mrc
Expand Down
6 changes: 3 additions & 3 deletions lib/net/protocol/lesprotocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let id = new BN(0)
const messages = [{
name: 'Announce',
code: 0x01,
encode: ({headHash, headNumber, headTd, reorgDepth}) => [
encode: ({ headHash, headNumber, headTd, reorgDepth }) => [
// TO DO: handle state changes
headHash,
headNumber.toArrayLike(Buffer),
Expand All @@ -28,7 +28,7 @@ const messages = [{
name: 'GetBlockHeaders',
code: 0x02,
response: 0x03,
encode: ({reqId, block, max, skip = 0, reverse = 0}) => [
encode: ({ reqId, block, max, skip = 0, reverse = 0 }) => [
(reqId === undefined ? id.iaddn(1) : new BN(reqId)).toArrayLike(Buffer),
[ BN.isBN(block) ? block.toArrayLike(Buffer) : block, max, skip, reverse ]
],
Expand All @@ -42,7 +42,7 @@ const messages = [{
}, {
name: 'BlockHeaders',
code: 0x03,
encode: ({reqId, bv, headers}) => [
encode: ({ reqId, bv, headers }) => [
new BN(reqId).toArrayLike(Buffer),
new BN(bv).toArrayLike(Buffer),
headers.map(h => h.raw)
Expand Down
2 changes: 1 addition & 1 deletion lib/net/server/libp2pserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Libp2pServer extends Server {
*/
constructor (options) {
super(options)
options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }
this.multiaddrs = options.multiaddrs
this.key = options.key
this.bootnodes = options.bootnodes
Expand Down
2 changes: 1 addition & 1 deletion lib/net/server/rlpxserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class RlpxServer extends Server {
*/
constructor (options) {
super(options)
options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }

this.port = options.port
this.key = options.key
Expand Down
2 changes: 1 addition & 1 deletion lib/net/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const defaultOptions = {
class Server extends EventEmitter {
constructor (options) {
super()
options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }

this.logger = options.logger
this.maxPeers = options.maxPeers
Expand Down
2 changes: 1 addition & 1 deletion lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Node extends EventEmitter {
*/
constructor (options) {
super()
options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }

this.logger = options.logger
this.common = options.common
Expand Down
2 changes: 1 addition & 1 deletion lib/sync/fetcher/blockfetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class BlockFetcher extends Fetcher {
*/
constructor (options) {
super(options)
options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }
this.maxPerRequest = options.maxPerRequest
this.chain = options.chain
this.first = options.first
Expand Down
4 changes: 2 additions & 2 deletions lib/sync/fetcher/fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class Fetcher extends Readable {
* @param {Logger} [options.logger] Logger instance
*/
constructor (options) {
super({...options, objectMode: true})
options = {...defaultOptions, ...options}
super({ ...options, objectMode: true })
options = { ...defaultOptions, ...options }

this.pool = options.pool
this.logger = options.logger
Expand Down
2 changes: 1 addition & 1 deletion lib/sync/fetcher/headerfetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HeaderFetcher extends BlockFetcher {
*/
constructor (options) {
super(options)
options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }
this.flow = options.flow
}

Expand Down
2 changes: 1 addition & 1 deletion lib/sync/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Synchronizer extends EventEmitter {
*/
constructor (options) {
super()
options = {...defaultOptions, ...options}
options = { ...defaultOptions, ...options }

this.logger = options.logger
this.pool = options.pool
Expand Down
2 changes: 1 addition & 1 deletion lib/util/parse.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const Account = require('ethereumjs-account')
const Account = require('ethereumjs-account').default
const Block = require('ethereumjs-block')
const Trie = require('merkle-patricia-tree/secure')
const util = require('ethereumjs-util')
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,34 @@
"homepage": "https://github.com/ethereumjs/ethereumjs-client#readme",
"dependencies": {
"chalk": "^2.4.1",
"ethereumjs-account": "^2.0.5",
"ethereumjs-account": "^3.0.0",
"ethereumjs-block": "^2.2.0",
"ethereumjs-blockchain": "^3.4.0",
"ethereumjs-common": "^1.1.0",
"ethereumjs-devp2p": "^2.5.1",
"ethereumjs-util": "^6.1.0",
"fs-extra": "^6.0.1",
"fs-extra": "^7.0.1",
"jayson": "^2.0.6",
"level": "^4.0.0",
"libp2p": "^0.23.1",
"libp2p": "^0.24.4",
"libp2p-bootstrap": "^0.9.3",
"libp2p-kad-dht": "^0.10.5",
"libp2p-kad-dht": "^0.14.5",
"libp2p-mplex": "^0.8.2",
"libp2p-secio": "^0.10.0",
"libp2p-secio": "^0.11.1",
"libp2p-tcp": "^0.13.0",
"libp2p-websockets": "^0.12.0",
"merkle-patricia-tree": "^2.3.1",
"merkle-patricia-tree": "^3.0.0",
"ms": "^2.1.1",
"peer-id": "^0.11.0",
"peer-info": "^0.14.1",
"peer-id": "^0.12.2",
"peer-info": "^0.15.1",
"pull-catch": "^1.0.0",
"pull-pushable": "^2.2.0",
"pull-stream": "^3.6.9",
"qheap": "^1.4.0",
"rlp": "^2.0.0",
"util-promisify": "^2.1.0",
"winston": "^3.1.0",
"yargs": "^11.0.0"
"yargs": "^13.2.1"
},
"devDependencies": {
"@babel/core": "^7.1.2",
Expand All @@ -88,12 +88,12 @@
"coveralls": "^3.0.0",
"json-to-markdown": "^1.0.4",
"level-browserify": "^2.0.0",
"nyc": "~11.6.0",
"nyc": "~13.3.0",
"pino": "^5.8.0",
"pino-pretty": "^2.2.2",
"standard": "~11.0.1",
"standard": "~12.0.1",
"supertest": "^3.1.0",
"tape": "~4.9.0",
"tape": "~4.10.1",
"tape-catch": "~1.0.6",
"testdouble": "^3.8.2",
"testdouble-timers": "^0.1.1",
Expand Down
4 changes: 2 additions & 2 deletions test/integration/fastethereumservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tape('[Integration:FastEthereumService]', async (t) => {
t.test('should handle ETH requests', async (t) => {
const [server, service] = await setup()
const peer = await server.accept('peer0')
const headers = await peer.eth.getBlockHeaders({block: 1, max: 2})
const headers = await peer.eth.getBlockHeaders({ block: 1, max: 2 })
const hash = Buffer.from('a321d27cd2743617c1c1b0d7ecb607dd14febcdfca8f01b79c3f0249505ea069', 'hex')
t.equals(headers[1].hash().toString('hex'), hash.toString('hex'), 'handled GetBlockHeaders')
const bodies = await peer.eth.getBlockBodies([hash])
Expand All @@ -45,7 +45,7 @@ tape('[Integration:FastEthereumService]', async (t) => {
t.test('should handle LES requests', async (t) => {
const [server, service] = await setup()
const peer = await server.accept('peer0')
const { headers } = await peer.les.getBlockHeaders({block: 1, max: 2})
const { headers } = await peer.les.getBlockHeaders({ block: 1, max: 2 })
t.equals(
headers[1].hash().toString('hex'),
'a321d27cd2743617c1c1b0d7ecb607dd14febcdfca8f01b79c3f0249505ea069',
Expand Down
18 changes: 9 additions & 9 deletions test/integration/fastsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ async function wait (delay) {

tape('[Integration:FastSync]', async (t) => {
async function setup (options = {}) {
const server = new MockServer({location: options.location})
const chain = new MockChain({height: options.height})
const server = new MockServer({ location: options.location })
const chain = new MockChain({ height: options.height })
const service = new FastEthereumService({
servers: [ server ],
minPeers: 1,
Expand All @@ -35,8 +35,8 @@ tape('[Integration:FastSync]', async (t) => {
}

t.test('should sync blocks', async (t) => {
const [remoteServer, remoteService] = await setup({location: '127.0.0.2', height: 200})
const [localServer, localService] = await setup({location: '127.0.0.1', height: 0})
const [remoteServer, remoteService] = await setup({ location: '127.0.0.2', height: 200 })
const [localServer, localService] = await setup({ location: '127.0.0.1', height: 0 })
localService.on('synchronized', async () => {
t.equals(localService.chain.blocks.height.toNumber(), 200, 'synced')
await destroy(localServer, localService)
Expand All @@ -47,8 +47,8 @@ tape('[Integration:FastSync]', async (t) => {
})

t.test('should not sync with stale peers', async (t) => {
const [remoteServer, remoteService] = await setup({location: '127.0.0.2', height: 9})
const [localServer, localService] = await setup({location: '127.0.0.1', height: 10})
const [remoteServer, remoteService] = await setup({ location: '127.0.0.2', height: 9 })
const [localServer, localService] = await setup({ location: '127.0.0.1', height: 10 })
localService.on('synchronized', async () => {
t.fail('synced with a stale peer')
})
Expand All @@ -61,9 +61,9 @@ tape('[Integration:FastSync]', async (t) => {
})

t.test('should sync with best peer', async (t) => {
const [remoteServer1, remoteService1] = await setup({location: '127.0.0.2', height: 9})
const [remoteServer2, remoteService2] = await setup({location: '127.0.0.3', height: 10})
const [localServer, localService] = await setup({location: '127.0.0.1', height: 0})
const [remoteServer1, remoteService1] = await setup({ location: '127.0.0.2', height: 9 })
const [remoteServer2, remoteService2] = await setup({ location: '127.0.0.3', height: 10 })
const [localServer, localService] = await setup({ location: '127.0.0.1', height: 0 })
await localService.synchronizer.stop()
await localServer.discover('remotePeer1', '127.0.0.2')
await localServer.discover('remotePeer2', '127.0.0.3')
Expand Down
18 changes: 9 additions & 9 deletions test/integration/lightsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ async function wait (delay) {

tape('[Integration:LightSync]', async (t) => {
async function setup (options = {}) {
const server = new MockServer({location: options.location})
const chain = new MockChain({height: options.height})
const server = new MockServer({ location: options.location })
const chain = new MockChain({ height: options.height })
const service = options.syncmode === 'fast'
? new FastEthereumService({
servers: [ server ],
Expand Down Expand Up @@ -42,8 +42,8 @@ tape('[Integration:LightSync]', async (t) => {
}

t.test('should sync headers', async (t) => {
const [remoteServer, remoteService] = await setup({location: '127.0.0.2', height: 200, syncmode: 'fast'})
const [localServer, localService] = await setup({location: '127.0.0.1', height: 0, syncmode: 'light'})
const [remoteServer, remoteService] = await setup({ location: '127.0.0.2', height: 200, syncmode: 'fast' })
const [localServer, localService] = await setup({ location: '127.0.0.1', height: 0, syncmode: 'light' })
localService.on('synchronized', async () => {
t.equals(localService.chain.headers.height.toNumber(), 200, 'synced')
await destroy(localServer, localService)
Expand All @@ -54,8 +54,8 @@ tape('[Integration:LightSync]', async (t) => {
})

t.test('should not sync with stale peers', async (t) => {
const [remoteServer, remoteService] = await setup({location: '127.0.0.2', height: 9, syncmode: 'fast'})
const [localServer, localService] = await setup({location: '127.0.0.1', height: 10, syncmode: 'light'})
const [remoteServer, remoteService] = await setup({ location: '127.0.0.2', height: 9, syncmode: 'fast' })
const [localServer, localService] = await setup({ location: '127.0.0.1', height: 10, syncmode: 'light' })
localService.on('synchronized', async () => {
t.fail('synced with a stale peer')
})
Expand All @@ -68,9 +68,9 @@ tape('[Integration:LightSync]', async (t) => {
})

t.test('should sync with best peer', async (t) => {
const [remoteServer1, remoteService1] = await setup({location: '127.0.0.2', height: 9, syncmode: 'fast'})
const [remoteServer2, remoteService2] = await setup({location: '127.0.0.3', height: 10, syncmode: 'fast'})
const [localServer, localService] = await setup({location: '127.0.0.1', height: 0, syncmode: 'light'})
const [remoteServer1, remoteService1] = await setup({ location: '127.0.0.2', height: 9, syncmode: 'fast' })
const [remoteServer2, remoteService2] = await setup({ location: '127.0.0.3', height: 10, syncmode: 'fast' })
const [localServer, localService] = await setup({ location: '127.0.0.1', height: 0, syncmode: 'light' })
await localService.synchronizer.stop()
await localServer.discover('remotePeer1', '127.0.0.2')
await localServer.discover('remotePeer2', '127.0.0.3')
Expand Down
6 changes: 3 additions & 3 deletions test/integration/mocks/mockserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@ class MockServer extends Server {
}

async discover (id, location) {
const peer = new MockPeer({id, location, protocols: Array.from(this.protocols)})
const peer = new MockPeer({ id, location, protocols: Array.from(this.protocols) })
await peer.connect()
this.peers[id] = peer
this.emit('connected', peer)
return peer
}

async accept (id) {
const peer = new MockPeer({id, protocols: Array.from(this.protocols)})
const peer = new MockPeer({ id, protocols: Array.from(this.protocols) })
await peer.accept(this)
return peer
}

async connect (connection) {
const id = connection.remoteId
const peer = new MockPeer({id, inbound: true, server: this, protocols: Array.from(this.protocols)})
const peer = new MockPeer({ id, inbound: true, server: this, protocols: Array.from(this.protocols) })
await peer.bindProtocols(connection)
this.peers[id] = peer
this.emit('connected', peer)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/peerpool.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tape('[Integration:PeerPool]', async (t) => {
t.plan(3)
const chain = new MockChain()
await chain.open()
const protocols = [ new EthProtocol({chain}) ]
const protocols = [ new EthProtocol({ chain }) ]
const [server, pool] = await setup(protocols)
pool.on('added', peer => t.equal(peer.id, 'peer0', 'added peer'))
pool.on('message', (msg, proto, peer) => {
Expand Down
Loading

0 comments on commit ff1d68c

Please sign in to comment.