nwaku/tests/waku_store/store_utils.nim
Ivan FB fd6a71cdd7
chore: Bump dependencies for v0.31.0 (#2885)
* 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
2024-07-09 13:14:28 +02:00

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)