Ivan FB 9f68c83fed chore: bump dependencies for v0.36 (#3410)
* properly pass userMessageLimit to OnchainGroupManager
* waku.nimble 2.2.4 Nim compiler
* rm stew/shims/net import
* change ValidIpAddress.init with parseIpAddress
* fix serialize for zerokit
* group_manager: separate if statements
* protocol_types: add encode UInt32 with zeros up to 32 bytes
* windows build: skip libunwind build and rm libunwind.a inlcusion step
* bump nph to overcome the compilation issues with 2.2.x
* bump nim-libp2p to v1.10.1
2025-05-26 21:58:02 +02:00

100 lines
2.2 KiB
Nim

{.used.}
import
testutils/unittests,
chronicles,
chronos,
libp2p/crypto/crypto,
libp2p/crypto/secp,
libp2p/multiaddress,
libp2p/switch
import ../testlib/wakucore, ../testlib/wakunode
include waku/factory/waku, waku/common/enr/typed_record
suite "Wakunode2 - Waku":
test "compilation version should be reported":
## Given
let conf = defaultTestWakuConf()
let waku = Waku.new(conf).valueOr:
raiseAssert error
## When
let version = waku.version
## Then
check:
version == git_version
suite "Wakunode2 - Waku initialization":
test "peer persistence setup should be successfully mounted":
## Given
var conf = defaultTestWakuConf()
conf.peerPersistence = true
let waku = Waku.new(conf).valueOr:
raiseAssert error
check:
not waku.node.peerManager.storage.isNil()
test "node setup is successful with default configuration":
## Given
var conf = defaultTestWakuConf()
## When
var waku = Waku.new(conf).valueOr:
raiseAssert error
(waitFor startWaku(addr waku)).isOkOr:
raiseAssert error
## Then
let node = waku.node
check:
not node.isNil()
node.wakuArchive.isNil()
node.wakuStore.isNil()
not node.wakuStoreClient.isNil()
not node.wakuRendezvous.isNil()
## Cleanup
waitFor waku.stop()
test "app properly handles dynamic port configuration":
## Given
var conf = defaultTestWakuConf()
conf.networkConf.p2pTcpPort = Port(0)
## When
var waku = Waku.new(conf).valueOr:
raiseAssert error
(waitFor startWaku(addr waku)).isOkOr:
raiseAssert error
## Then
let
node = waku.node
typedNodeEnr = node.enr.toTyped()
assert typedNodeEnr.isOk(), $typedNodeEnr.error
let tcpPort = typedNodeEnr.value.tcp()
assert tcpPort.isSome()
check tcpPort.get() != 0
check:
# Waku started properly
not node.isNil()
node.wakuArchive.isNil()
node.wakuStore.isNil()
not node.wakuStoreClient.isNil()
not node.wakuRendezvous.isNil()
# DS structures are updated with dynamic ports
typedNodeEnr.get().tcp.get() != 0
## Cleanup
waitFor waku.stop()