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

Fix connectSome test util #241

Merged
merged 2 commits into from
May 10, 2022
Merged

Fix connectSome test util #241

merged 2 commits into from
May 10, 2022

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented May 5, 2022

Motivation
In connectSome() function, it does not check for duplicate, a peer may connect to less than the specified "num" peers

Description
Maintain candidatePeers array and do the random on its key.

Close #240

@twoeths twoeths requested a review from a team as a code owner May 5, 2022 09:28
@codecov-commenter
Copy link

codecov-commenter commented May 5, 2022

Codecov Report

Merging #241 (da7d51a) into master (dc29113) will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #241      +/-   ##
==========================================
- Coverage   80.31%   80.27%   -0.04%     
==========================================
  Files          24       24              
  Lines        7661     7661              
  Branches      818      818              
==========================================
- Hits         6153     6150       -3     
- Misses       1508     1511       +3     
Impacted Files Coverage Δ
ts/score/peer-score.ts 92.09% <0.00%> (-0.50%) ⬇️

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 dc29113...da7d51a. Read the comment docs.

@dapplion
Copy link
Contributor

dapplion commented May 5, 2022

Tagging for review @achingbrain if available

Copy link
Contributor

@dapplion dapplion left a comment

Choose a reason for hiding this comment

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

I haven't reviewed the algorithm correctness, otherwise LGTM

@dapplion dapplion merged commit f05b1f4 into master May 10, 2022
@dapplion dapplion deleted the tuyen/connectSome branch May 10, 2022 08:56
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.

connectSome test method
3 participants