2023-11-27 17:33:27 +00:00
|
|
|
{.used.}
|
|
|
|
|
2024-03-15 23:08:47 +00:00
|
|
|
import std/options, chronos, chronicles, libp2p/crypto/crypto
|
2023-11-27 17:33:27 +00:00
|
|
|
|
|
|
|
import
|
2024-07-05 22:03:38 +00:00
|
|
|
waku/[node/peer_manager, waku_core, waku_store, waku_store/client],
|
2024-03-15 23:08:47 +00:00
|
|
|
../testlib/[common, wakucore]
|
2023-11-27 17:33:27 +00:00
|
|
|
|
2024-03-15 23:08:47 +00:00
|
|
|
proc newTestWakuStore*(
|
2024-04-25 13:09:52 +00:00
|
|
|
switch: Switch, handler: StoreQueryRequestHandler
|
2024-03-15 23:08:47 +00:00
|
|
|
): Future[WakuStore] {.async.} =
|
2023-11-27 17:33:27 +00:00
|
|
|
let
|
|
|
|
peerManager = PeerManager.new(switch)
|
|
|
|
proto = WakuStore.new(peerManager, rng, handler)
|
|
|
|
|
|
|
|
await proto.start()
|
|
|
|
switch.mount(proto)
|
|
|
|
|
|
|
|
return proto
|
|
|
|
|
|
|
|
proc newTestWakuStoreClient*(switch: Switch): WakuStoreClient =
|
|
|
|
let peerManager = PeerManager.new(switch)
|
|
|
|
WakuStoreClient.new(peerManager, rng)
|