Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #110 from ethereumjs/fix/synchronized-event-remove…
Browse files Browse the repository at this point in the history
…-stats

fix: remove references to old synchronize event stats obj
  • Loading branch information
vpulim committed May 16, 2019
2 parents d5bab71 + fd485b8 commit ddef972
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ exports.run = function (args) {
node.on('listening', details => {
logger.info(`Listener up transport=${details.transport} url=${details.url}`)
})
node.on('synchronized', (stats) => {
logger.info(`Synchronized ${stats.count} ${stats.type === 'light' ? 'headers' : 'blocks'}`)
node.on('synchronized', () => {
logger.info('Synchronized')
})
node.open().then(() => {
logger.info('Synchronizing blockchain...')
Expand Down
4 changes: 2 additions & 2 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class Node extends EventEmitter {
s.on('error', error => {
this.emit('error', error)
})
s.on('synchronized', stats => {
this.emit('synchronized', stats)
s.on('synchronized', () => {
this.emit('synchronized')
})
})
await Promise.all(this.services.map(s => s.open()))
Expand Down
4 changes: 2 additions & 2 deletions test/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ tape('[Node]', t => {
if (err === 'err1') t.pass('got err1')
})
node.on('listening', details => t.equals(details, 'details0', 'got listening'))
node.on('synchronized', stats => t.equals(stats, 'stats0', 'got synchronized'))
node.on('synchronized', () => t.ok('got synchronized'))
await node.open()
servers[0].emit('error', 'err0')
servers[0].emit('listening', 'details0')
node.services[0].emit('error', 'err1')
node.services[0].emit('synchronized', 'stats0')
node.services[0].emit('synchronized')
t.ok(node.opened, 'opened')
t.equals(await node.open(), false, 'already opened')
})
Expand Down

0 comments on commit ddef972

Please sign in to comment.