This commit is contained in:
parent
3dd79479bb
commit
f4e1147f64
|
@ -34,15 +34,11 @@ suite "Autorelay":
|
||||||
checkTrackers()
|
checkTrackers()
|
||||||
|
|
||||||
var
|
var
|
||||||
rng {.threadvar.}: ref HmacDrbgContext
|
|
||||||
switchRelay {.threadvar.}: Switch
|
switchRelay {.threadvar.}: Switch
|
||||||
switchClient {.threadvar.}: Switch
|
switchClient {.threadvar.}: Switch
|
||||||
relayClient {.threadvar.}: RelayClient
|
relayClient {.threadvar.}: RelayClient
|
||||||
autorelay {.threadvar.}: AutoRelayService
|
autorelay {.threadvar.}: AutoRelayService
|
||||||
|
|
||||||
asyncSetup:
|
|
||||||
rng = newRng()
|
|
||||||
|
|
||||||
asyncTest "Simple test":
|
asyncTest "Simple test":
|
||||||
switchRelay = createSwitch(Relay.new())
|
switchRelay = createSwitch(Relay.new())
|
||||||
relayClient = RelayClient.new()
|
relayClient = RelayClient.new()
|
||||||
|
@ -51,7 +47,7 @@ suite "Autorelay":
|
||||||
check: addresses[0] == buildRelayMA(switchRelay, switchClient)
|
check: addresses[0] == buildRelayMA(switchRelay, switchClient)
|
||||||
check: addresses.len() == 1
|
check: addresses.len() == 1
|
||||||
fut.complete()
|
fut.complete()
|
||||||
autorelay = AutoRelayService.new(3, relayClient, checkMA, rng)
|
autorelay = AutoRelayService.new(3, relayClient, checkMA, newRng())
|
||||||
switchClient = createSwitch(relayClient, autorelay)
|
switchClient = createSwitch(relayClient, autorelay)
|
||||||
await allFutures(switchClient.start(), switchRelay.start())
|
await allFutures(switchClient.start(), switchRelay.start())
|
||||||
await switchClient.connect(switchRelay.peerInfo.peerId, switchRelay.peerInfo.addrs)
|
await switchClient.connect(switchRelay.peerInfo.peerId, switchRelay.peerInfo.addrs)
|
||||||
|
|
Loading…
Reference in New Issue