mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-13 16:25:00 +00:00
fd6a71cdd7
* bump_dependencies.md: add nim-results dependency * change imports stew/results to results * switching to Nim 2.0.8 * waku.nimble: reflect the requirement nim 1.6.0 to 2.0.8 Adding --mm:refc as nim 2.0 enables a new garbage collector that we're not yet ready to support * adapt waku code to Nim 2.0 * gcsafe adaptations because Nim 2.0 is more strict
24 lines
616 B
Nim
24 lines
616 B
Nim
{.used.}
|
|
|
|
import std/options, chronos, chronicles, libp2p/crypto/crypto
|
|
|
|
import
|
|
waku/[node/peer_manager, waku_core, waku_store, waku_store/client],
|
|
../testlib/[common, wakucore]
|
|
|
|
proc newTestWakuStore*(
|
|
switch: Switch, handler: StoreQueryRequestHandler
|
|
): Future[WakuStore] {.async.} =
|
|
let
|
|
peerManager = PeerManager.new(switch)
|
|
proto = WakuStore.new(peerManager, rng, handler)
|
|
|
|
await proto.start()
|
|
switch.mount(proto)
|
|
|
|
return proto
|
|
|
|
proc newTestWakuStoreClient*(switch: Switch): WakuStoreClient {.gcsafe.} =
|
|
let peerManager = PeerManager.new(switch)
|
|
WakuStoreClient.new(peerManager, rng)
|