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
32 lines
903 B
Nim
32 lines
903 B
Nim
{.used.}
|
|
|
|
import std/options, chronos, chronicles, libp2p/crypto/crypto
|
|
|
|
logScope:
|
|
topics = "test waku_lightpush_legacy"
|
|
|
|
import
|
|
waku/node/peer_manager,
|
|
waku/waku_lightpush_legacy,
|
|
waku/waku_lightpush_legacy/[client, common],
|
|
waku/common/rate_limit/setting,
|
|
../testlib/[common, wakucore]
|
|
|
|
proc newTestWakuLegacyLightpushNode*(
|
|
switch: Switch,
|
|
handler: PushMessageHandler,
|
|
rateLimitSetting: Option[RateLimitSetting] = none[RateLimitSetting](),
|
|
): Future[WakuLegacyLightPush] {.async.} =
|
|
let
|
|
peerManager = PeerManager.new(switch)
|
|
proto = WakuLegacyLightPush.new(peerManager, crypto.newRng(), handler, rateLimitSetting)
|
|
|
|
await proto.start()
|
|
switch.mount(proto)
|
|
|
|
return proto
|
|
|
|
proc newTestWakuLegacyLightpushClient*(switch: Switch): WakuLegacyLightPushClient =
|
|
let peerManager = PeerManager.new(switch)
|
|
WakuLegacyLightPushClient.new(peerManager, crypto.newRng())
|