mirror of
https://github.com/logos-messaging/logos-delivery.git
synced 2026-06-04 13:09:32 +00:00
* bump libp2p pin to release/v2.0.0 (c43199378) * pin nimble.lock: lsquic/websock/boringssl/protobuf_serialization/npeg/jwt * add libp2p_mix dep and point libp2p/protocols/mix -> libp2p_mix * migrate rng to libp2p Rng type (prod, channels, noise, tests) * noise: take Rng, extract bearSslDrbg internally * waku_switch: TransportConfig factory; withMaxInOut; local MaxConnections * waku_relay/rendezvous/discv5/kademlia: v2.0.0 API (rng, config, ServiceDiscovery) * tests: newStandardSwitch shim; PeerId.random(rng); common.rng()/crypto.newRng() * drop libp2p/utils/semaphore (use chronos AsyncSemaphore) * add waku/compat/option_valueor shim where needed * add std/options where transitive re-export dropped
23 lines
599 B
Nim
23 lines
599 B
Nim
{.used.}
|
|
|
|
import std/options, chronos, chronicles
|
|
|
|
import
|
|
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, common.rng(), handler)
|
|
|
|
await proto.start()
|
|
switch.mount(proto)
|
|
|
|
return proto
|
|
|
|
proc newTestWakuStoreClient*(switch: Switch): WakuStoreClient {.gcsafe.} =
|
|
let peerManager = PeerManager.new(switch)
|
|
WakuStoreClient.new(peerManager, common.rng())
|