-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: preventing IP 0.0.0.0 from being published and allowing peer exc…
…hange connections with localhost IPs
- Loading branch information
1 parent
ea31b53
commit 7772e87
Showing
5 changed files
with
41 additions
and
7 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