logos-delivery/tests/waku_store/store_utils.nim
Ivan FB 3b03ca29b1
refactor: introduce proper logos_delivery layers folder structure (#3935)
Co-authored-by: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com>
2026-06-08 13:37:53 +02:00

24 lines
598 B
Nim

{.used.}
import std/options, chronos, chronicles
import
logos_delivery/waku/[node/peer_manager, 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)