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

Add net_peerCount RPC method #75

Merged
merged 1 commit into from
Dec 5, 2018
Merged

Add net_peerCount RPC method #75

merged 1 commit into from
Dec 5, 2018

Conversation

aunyks
Copy link
Contributor

@aunyks aunyks commented Dec 3, 2018

No description provided.

@coveralls
Copy link

coveralls commented Dec 3, 2018

Coverage Status

Coverage increased (+0.02%) to 92.719% when pulling bcebd87 on aunyks:master into 044368a on ethereumjs:master.

@holgerd77
Copy link
Member

Hi Gerald, very cool that you are doing continued work on this! 👍

@aunyks
Copy link
Contributor Author

aunyks commented Dec 4, 2018

Thanks Holger!

Copy link
Contributor

@vpulim vpulim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to re-iterate @holgerd77's comment, we love that you are continuing to contribute! Thank you :)

I made a couple minor suggestions to simplify the code. But also, I noticed a lot of what looks like lint fixes. Were these generated using lint:fix? If so, you should do any style/whitespace fixes in a separate PR so it makes code reviews easier. And a related question: if lint:fix is making these changes, why is it changing code that is already passing lint checks?


class Net {
constructor (node) {
const service = node.services.find(s => s.name === 'eth')
this._chain = service.chain
this._node = node
this._peerPool = service.synchronizer.pool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just grab the pool directly from service:

Suggested change
this._peerPool = service.synchronizer.pool
this._peerPool = service.pool

{
name: 'eth',
chain: chain,
synchronizer: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Suggested change:

services: [
      {
        name: 'eth',
        chain: chain,
        pool: { peers: [1, 2, 3] }
      }

@aunyks
Copy link
Contributor Author

aunyks commented Dec 4, 2018

I think it's the default Prettier config in my VS Code code setup doing that. I'll refactor and change my editor settings to abide by the Standard config.

@aunyks
Copy link
Contributor Author

aunyks commented Dec 4, 2018

Changes to the non-net/peerCount RPC tests are a resolution to errors that arise when creating a test node: they must have a synchronizer or pool key, otherwise the test will fail due to an erroneously trying to retrieve one of those values.

@aunyks
Copy link
Contributor Author

aunyks commented Dec 5, 2018

Should be ready now.

@vpulim
Copy link
Contributor

vpulim commented Dec 5, 2018

Looks like there are still a lot of prettier generated changes, but they're limited to the test scripts so I'll go ahead and merge this PR. Would be ideal in future PRs to limit diffs to just the relevant code changes. Regardless, thanks again for this contribution! 👍

Copy link
Contributor

@vpulim vpulim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vpulim vpulim merged commit 2c9cecb into ethereumjs:master Dec 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants