Skip to content

Commit

Permalink
tests: fix TestP2PPrivateAddresses
Browse files Browse the repository at this point in the history
After multiformats/go-multiaddr#235 the test example became invalid, fixed
  • Loading branch information
algorandskiy committed Sep 23, 2024
1 parent 1375a58 commit 8103832
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion network/p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ func formatPeerTelemetryInfoProtocolName(telemetryID string, telemetryInstance s
var private6 = parseCIDR([]string{
"100::/64",
"2001:2::/48",
"2001:db8::/32", // multiaddr v0.13 has it
})

// parseCIDR converts string CIDRs to net.IPNet.
Expand Down
4 changes: 2 additions & 2 deletions network/p2p/p2p_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ func TestP2PPrivateAddresses(t *testing.T) {
"/ip4/255.255.255.255/ipcidr/32",
"/ip6/fc00::/ipcidr/7",
"/ip6/fe80::/ipcidr/10",
"/ip6/2001:db8::/ipcidr/32",
}

// these are handled by addrFilter explicitly as a custom filter
extra := []string{
"/ip6/100::/ipcidr/64",
"/ip6/2001:2::/ipcidr/48",
"/ip6/2001:db8::/ipcidr/32", // multiaddr v0.13 has it
}

for _, addr := range privAddrList {
Expand All @@ -220,7 +220,7 @@ func TestP2PPrivateAddresses(t *testing.T) {
// ensure addrFilter allows normal addresses
valid := []string{
"/ip4/3.4.5.6/tcp/1234",
"/ip6/200:11::/tcp/1234",
"/ip6/2606:4700::/tcp/1234",
}

for _, addr := range valid {
Expand Down

0 comments on commit 8103832

Please sign in to comment.