This commit is contained in:
Ludovic Chenut 2022-12-21 11:05:20 +01:00
parent 3dd79479bb
commit f4e1147f64
No known key found for this signature in database
GPG Key ID: D9A59B1907F1D50C
1 changed files with 1 additions and 5 deletions

View File

@ -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)