Fabiana Cecin 1f5f4c2816
Fixes
* Fix libp2p bump to v2.0.0 tag
* Fix libp2p_mix bump to commit that references libp2p v2.0.0
* Fix lint
2026-06-10 11:52:49 -03:00

33 lines
969 B
Nim

{.used.}
import std/options, chronos, chronicles, libp2p/crypto/crypto
logScope:
topics = "test waku_lightpush_legacy"
import
logos_delivery/waku/node/peer_manager,
logos_delivery/waku/waku_lightpush_legacy,
logos_delivery/waku/waku_lightpush_legacy/[client, common],
logos_delivery/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())