logos-messaging-nim/tests/waku_core/test_published_address.nim
Fabiana Cecin 7b6d5d542c
fix: remove hardcoded ports in tests (#3998)
* Remove hardcoded ports in tests
* Promote getPorts to a public helper in net/net_config.nim
* Make 0.0.0.0:0 a default argument for newTestWakuNode
2026-06-30 14:59:27 -03:00

19 lines
482 B
Nim

{.used.}
import std/[strutils, net], testutils/unittests
import ../testlib/wakucore, ../testlib/wakunode
suite "Waku Core - Published Address":
test "Test IP 0.0.0.0":
let node = newTestWakuNode(generateSecp256k1Key())
check:
($node.announcedAddresses).contains("127.0.0.1")
test "Test custom IP":
let node =
newTestWakuNode(generateSecp256k1Key(), parseIpAddress("8.8.8.8"), Port(0))
check:
($node.announcedAddresses).contains("8.8.8.8")