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