added test wrt subscribe and unsubscribe

This commit is contained in:
shashankshampi 2024-09-26 11:28:07 +05:30
parent 09fe199b6b
commit 871efab571
2 changed files with 7 additions and 6 deletions

1
.gitignore vendored
View File

@ -11,6 +11,7 @@ build/
*.exe
*.dll
.vscode/
.idea/
.DS_Store
tests/pubsub/testgossipsub
examples/*.md

View File

@ -7,6 +7,12 @@
# This file may not be copied, modified, or distributed except according to
# those terms.
)
await GossipSub(nodes[1]).addDirectPeer(
nodes[2].switch.peerInfo.peerId, nodes[2].switch.peerInfo.addrs
)
await GossipSub(nodes[2]).addDirectPeer(
nodes[1].switch.peerInfo.peerId, nodes[1].switch.peerInfo.addrs
{.used.}
import sequtils, options, tables, sets
@ -178,12 +184,6 @@ suite "GossipSub":
await GossipSub(nodes[1]).addDirectPeer(
nodes[0].switch.peerInfo.peerId, nodes[0].switch.peerInfo.addrs
)
await GossipSub(nodes[1]).addDirectPeer(
nodes[2].switch.peerInfo.peerId, nodes[2].switch.peerInfo.addrs
)
await GossipSub(nodes[2]).addDirectPeer(
nodes[1].switch.peerInfo.peerId, nodes[1].switch.peerInfo.addrs
)
var handlerFut = newFuture[void]()
proc handler(topic: string, data: seq[byte]) {.async.} =