Skip to content

Commit

Permalink
apply Zoltan suggestion to simplify tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Oct 26, 2024
1 parent 16cf26b commit eae4e8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
18 changes: 4 additions & 14 deletions tests/test_peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,9 @@ procSuite "Peer Manager":
database = SqliteDatabase.new(":memory:")[]
storage = WakuPeerStorage.new(database)[]
node1 = newTestWakuNode(
generateSecp256k1Key(),
ValidIpAddress.init($getPrimaryIPAddr()),
Port(44048),
peerStorage = storage,
)
node2 = newTestWakuNode(
generateSecp256k1Key(), ValidIpAddress.init($getPrimaryIPAddr()), Port(34023)
generateSecp256k1Key(), getPrimaryIPAddr(), Port(44048), peerStorage = storage
)
node2 = newTestWakuNode(generateSecp256k1Key(), getPrimaryIPAddr(), Port(34023))

node1.mountMetadata(0).expect("Mounted Waku Metadata")
node2.mountMetadata(0).expect("Mounted Waku Metadata")
Expand Down Expand Up @@ -344,14 +339,9 @@ procSuite "Peer Manager":
database = SqliteDatabase.new(":memory:")[]
storage = WakuPeerStorage.new(database)[]
node1 = newTestWakuNode(
generateSecp256k1Key(),
ValidIpAddress.init($getPrimaryIPAddr()),
Port(44048),
peerStorage = storage,
)
node2 = newTestWakuNode(
generateSecp256k1Key(), ValidIpAddress.init($getPrimaryIPAddr()), Port(34023)
generateSecp256k1Key(), getPrimaryIPAddr(), Port(44048), peerStorage = storage
)
node2 = newTestWakuNode(generateSecp256k1Key(), getPrimaryIPAddr(), Port(34023))

node1.mountMetadata(0).expect("Mounted Waku Metadata")
node2.mountMetadata(0).expect("Mounted Waku Metadata")
Expand Down
4 changes: 2 additions & 2 deletions tests/test_wakunode.nim
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ suite "WakuNode":
nodeKey = generateSecp256k1Key()
bindIp = parseIpAddress("0.0.0.0")
bindPort = Port(61006)
extIp = some(parseIpAddress($getPrimaryIPAddr()))
extIp = some(getPrimaryIPAddr())
extPort = some(Port(61008))
node = newTestWakuNode(nodeKey, bindIp, bindPort, extIp, extPort)

Expand Down Expand Up @@ -205,7 +205,7 @@ suite "WakuNode":
nodeKey = generateSecp256k1Key()
bindIp = parseIpAddress("0.0.0.0")
bindPort = Port(61010)
extIp = some(parseIpAddress($getPrimaryIPAddr()))
extIp = some(getPrimaryIPAddr())
extPort = some(Port(61012))
domainName = "example.com"
expectedDns4Addr =
Expand Down

0 comments on commit eae4e8b

Please sign in to comment.