SIGSERV failing isolateed a bit more

This commit is contained in:
Oskar Thoren 2020-05-14 10:42:04 +08:00
parent 2e9c2ed949
commit c6bd02ba38
No known key found for this signature in database
GPG Key ID: B2ECCFD3BC2EF77E
2 changed files with 7 additions and 7 deletions

View File

@ -8,8 +8,8 @@ import
libp2p/transports/[transport, tcptransport],
libp2p/muxers/[muxer, mplex/mplex, mplex/types],
libp2p/protocols/[identify, secure/secure],
libp2p/protocols/pubsub/[pubsub, gossipsub, floodsub]
# waku_protocol
libp2p/protocols/pubsub/[pubsub, gossipsub, floodsub],
../../waku/protocol/v2/waku_protocol
when libp2p_secure == "noise":
import libp2p/protocols/secure/noise
@ -42,6 +42,7 @@ proc newStandardSwitch*(privKey = none(PrivateKey),
else:
# Creating switch from generate node
# XXX: Hacky test, hijacking WakuSub here
# XXX: If I use WakuSub here I get a SIGSERV
#echo "Using WakuSub here"
PubSub newPubSub(FloodSub, peerInfo, triggerSelf)
#PubSub newPubSub(WakuSub, peerInfo, triggerSelf)

View File

@ -15,11 +15,8 @@ import utils,
connection,
stream/bufferstream,
crypto/crypto,
#protocols/pubsub/pubsub,
protocols/pubsub/floodsub,
#protocols/pubsub/rpc/messages,
#protocols/pubsub/rpc/message
]
protocols/pubsub/floodsub]
import ../../waku/protocol/v2/waku_protocol
const
StreamTransportTrackerName = "stream.transport"
@ -27,6 +24,7 @@ const
# TODO: Start with floodsub here, then move other logic here
# XXX: If I cast to WakuSub here I get a SIGSEGV
proc waitSub(sender, receiver: auto; key: string) {.async, gcsafe.} =
# turn things deterministic
# this is for testing purposes only
@ -57,6 +55,7 @@ suite "FloodSub":
proc runTests(): Future[bool] {.async.} =
var completionFut = newFuture[bool]()
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
echo "Hit handler", topic
check topic == "foobar"
completionFut.complete(true)