rust interop fixes

This commit is contained in:
Dmitriy Ryajov 2020-04-28 17:59:38 -06:00
parent 8e48bb117d
commit 5f704e6825
1 changed files with 12 additions and 6 deletions

View File

@ -52,7 +52,8 @@ suite "GossipSub":
proc runTests(): Future[bool] {.async.} =
var handlerFut = newFuture[bool]()
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
check topic == "foobar"
check:
topic == "foobar"
handlerFut.complete(true)
var nodes = generateNodes(2, true)
@ -71,7 +72,8 @@ suite "GossipSub":
proc validator(topic: string,
message: Message):
Future[bool] {.async.} =
check topic == "foobar"
check:
topic == "foobar"
validatorFut.complete(true)
result = true
@ -88,7 +90,8 @@ suite "GossipSub":
test "GossipSub validation should fail":
proc runTests(): Future[bool] {.async.} =
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
check false # if we get here, it should fail
check:
false # if we get here, it should fail
var nodes = generateNodes(2, true)
var awaiters: seq[Future[void]]
@ -122,7 +125,8 @@ suite "GossipSub":
proc runTests(): Future[bool] {.async.} =
var handlerFut = newFuture[bool]()
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
check topic == "foo"
check:
topic == "foo"
handlerFut.complete(true)
var nodes = generateNodes(2, true)
@ -243,7 +247,8 @@ suite "GossipSub":
proc runTests(): Future[bool] {.async.} =
var passed = newFuture[void]()
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
check topic == "foobar"
check:
topic == "foobar"
passed.complete()
var nodes = generateNodes(2, true)
@ -291,7 +296,8 @@ suite "GossipSub":
proc runTests(): Future[bool] {.async.} =
var passed: Future[bool] = newFuture[bool]()
proc handler(topic: string, data: seq[byte]) {.async, gcsafe.} =
check topic == "foobar"
check:
topic == "foobar"
passed.complete(true)
var nodes = generateNodes(2, true)