-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent IP 0.0.0.0 from being published and update peers with em…
…pty ENR data (#1982)
- Loading branch information
1 parent
645b034
commit 47ae19c
Showing
5 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{.used.} | ||
|
||
import | ||
stew/shims/net as stewNet, | ||
std/strutils, | ||
testutils/unittests | ||
import | ||
../testlib/wakucore, | ||
../testlib/wakunode | ||
|
||
suite "Waku Core - Published Address": | ||
|
||
test "Test IP 0.0.0.0": | ||
let | ||
node = newTestWakuNode(generateSecp256k1Key(), ValidIpAddress.init( | ||
"0.0.0.0"),Port(0)) | ||
|
||
check: | ||
($node.announcedAddresses).contains("127.0.0.1") | ||
|
||
test "Test custom IP": | ||
let | ||
node = newTestWakuNode(generateSecp256k1Key(), ValidIpAddress.init( | ||
"8.8.8.8"),Port(0)) | ||
|
||
check: | ||
($node.announcedAddresses).contains("8.8.8.8") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters