mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-07 18:43:33 +00:00
added test wrt subscribe and unsubscribe
This commit is contained in:
parent
09fe199b6b
commit
871efab571
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,6 +11,7 @@ build/
|
|||||||
*.exe
|
*.exe
|
||||||
*.dll
|
*.dll
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.idea/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
tests/pubsub/testgossipsub
|
tests/pubsub/testgossipsub
|
||||||
examples/*.md
|
examples/*.md
|
||||||
|
@ -7,6 +7,12 @@
|
|||||||
# This file may not be copied, modified, or distributed except according to
|
# This file may not be copied, modified, or distributed except according to
|
||||||
# those terms.
|
# 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.}
|
{.used.}
|
||||||
|
|
||||||
import sequtils, options, tables, sets
|
import sequtils, options, tables, sets
|
||||||
@ -178,12 +184,6 @@ suite "GossipSub":
|
|||||||
await GossipSub(nodes[1]).addDirectPeer(
|
await GossipSub(nodes[1]).addDirectPeer(
|
||||||
nodes[0].switch.peerInfo.peerId, nodes[0].switch.peerInfo.addrs
|
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]()
|
var handlerFut = newFuture[void]()
|
||||||
proc handler(topic: string, data: seq[byte]) {.async.} =
|
proc handler(topic: string, data: seq[byte]) {.async.} =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user