Skip to content

Commit

Permalink
adding failure test case
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer committed Oct 18, 2024
1 parent 9a66678 commit 8b4f6f6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/waku_discv5/test_waku_discv5.nim
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,23 @@ suite "Waku Discovery v5":
waku.node.peerManager.wakuPeerStore.peers().anyIt(
it.enr.isSome() and it.enr.get().toUri() == validEnr
)

asyncTest "Invalid discv5 bootstrap node ENRs are ignored":
var conf = defaultTestWakuNodeConf()

let invalidEnr = "invalid-enr"

conf.discv5BootstrapNodes = @[invalidEnr]

let waku = Waku.init(conf).valueOr:
raiseAssert error

discard setupDiscoveryV5(
waku.node.enr, waku.node.peerManager, waku.node.topicSubscriptionQueue,
waku.conf, waku.dynamicBootstrapNodes, waku.rng, waku.key,
)

check:
not waku.node.peerManager.wakuPeerStore.peers().anyIt(
it.enr.isSome() and it.enr.get().toUri() == invalidEnr
)

0 comments on commit 8b4f6f6

Please sign in to comment.