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

Resolve peers before filtering #32

Merged
merged 4 commits into from
Jun 25, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added additional test cases and comments
  • Loading branch information
doug-perlin committed Jun 25, 2018
commit ccede8ab75523a7854fe970271979846840510fb
4 changes: 4 additions & 0 deletions network/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ func TestFilterPeers(t *testing.T) {
"10.0.0.3:3000",
"10.0.0.6:3000",
"localhost:3004",
"::1:3005",
})
expected := []string{
"10.0.0.5:3000",
"10.0.0.1:3000",
// "10.0.0.1:3000" is a duplicate
"10.0.0.1:2000",
// "10.0.0.3:3000" is filtered
"10.0.0.6:3000",
"127.0.0.1:3004",
// "::1:3005" will be removed
}
if !reflect.DeepEqual(result, expected) {
t.Fatalf("Unexpected got %v, but expected %v", result, expected)
Expand Down