Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for v2 #1142

Merged
merged 6 commits into from Oct 18, 2018
Merged

Updated for v2 #1142

merged 6 commits into from Oct 18, 2018

Conversation

kalgoop
Copy link
Contributor

@kalgoop kalgoop commented Oct 17, 2018

'delay' is changed to 'latency' in v2

Proposed changes

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improve a current implementation without adding a new feature or fixing a bug)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Build (changes that affect the build system)
  • Docs (documentation only changes)
  • Test (adding missing tests or fixing existing tests)
  • Other... Please describe:

Checklist

  • I have read the CONTRIBUTING documentation
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

'delay' is changed to 'latency' in v2
@alexbarnsley
Copy link
Member

Thanks for your change. This should be split up into 2 methods though, as currently the client is designed to work with both v1 and v2 networks, so it should check which version to see which column needs to be sorted by.

This will support both v1 and v2 APIs.
@kalgoop
Copy link
Contributor Author

kalgoop commented Oct 17, 2018

Thanks for your change. This should be split up into 2 methods though, as currently the client is designed to work with both v1 and v2 networks, so it should check which version to see which column needs to be sorted by.

Thanks for the advice. Updated.
It checks if peers object has a property of 'delay' or 'latency', and accordingly uses orderBy operation.

@fix
Copy link
Contributor

fix commented Oct 17, 2018

this might be breaking with v1 protocol p2p layer.

@kalgoop
Copy link
Contributor Author

kalgoop commented Oct 17, 2018

@fix can you elaborate how it may break with v1 p2p?
I feel this will only improve situation from previous version.

Anyhow, adding another case. If it doesn't have both delay and latency properties, it is returned as it is

If peers doesn't have delay or latency property, peers is returned ' as is'.
@faustbrian faustbrian self-requested a review October 17, 2018 16:41
@codecov-io
Copy link

Codecov Report

Merging #1142 into develop will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1142      +/-   ##
===========================================
- Coverage    78.01%   78.01%   -0.01%     
===========================================
  Files          424      424              
  Lines         6891     6890       -1     
  Branches       883      883              
===========================================
- Hits          5376     5375       -1     
  Misses        1338     1338              
  Partials       177      177
Impacted Files Coverage Δ
packages/client/lib/utils/sort-peers.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a230fe5...04dde3c. Read the comment docs.

@faustbrian faustbrian merged commit b46da4e into ArkEcosystem:develop Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants