fix lint errors

This commit is contained in:
Prem Chaitanya Prathi 2026-02-12 10:54:54 +05:30
parent b943ece443
commit ab123e4843
No known key found for this signature in database
3 changed files with 21 additions and 13 deletions

View File

@ -494,7 +494,10 @@ proc processInput(rfd: AsyncFD, rng: ref HmacDrbgContext) {.async.} =
),
node.peerManager,
getMixNodePoolSize = proc(): int {.gcsafe, raises: [].} =
if node.wakuMix.isNil(): 0 else: node.getMixNodePoolSize(),
if node.wakuMix.isNil():
0
else:
node.getMixNodePoolSize(),
isNodeStarted = proc(): bool {.gcsafe, raises: [].} =
node.started,
).valueOr:

View File

@ -82,13 +82,15 @@ proc new*(
info "kademlia discovery created",
bootstrapNodes = params.bootstrapNodes.len, advertiseMix = params.advertiseMix
ok(WakuKademlia(
protocol: kademlia,
peerManager: peerManager,
running: false,
getMixNodePoolSize: getMixNodePoolSize,
isNodeStarted: isNodeStarted,
))
ok(
WakuKademlia(
protocol: kademlia,
peerManager: peerManager,
running: false,
getMixNodePoolSize: getMixNodePoolSize,
isNodeStarted: isNodeStarted,
)
)
proc extractMixPubKey(service: ServiceInfo): Option[Curve25519Key] =
if service.id != MixProtocolID:
@ -151,7 +153,9 @@ proc remotePeerInfoFrom(record: ExtendedPeerRecord): Option[RemotePeerInfo] =
)
)
proc lookupMixPeers*(wk: WakuKademlia): Future[Result[int, string]] {.async: (raises: []).} =
proc lookupMixPeers*(
wk: WakuKademlia
): Future[Result[int, string]] {.async: (raises: []).} =
## Lookup mix peers via kademlia and add them to the peer store.
## Returns the number of mix peers found and added.
if wk.protocol.isNil():
@ -185,9 +189,7 @@ proc lookupMixPeers*(wk: WakuKademlia): Future[Result[int, string]] {.async: (ra
return ok(added)
proc runDiscoveryLoop(
wk: WakuKademlia,
interval: Duration,
minMixPeers: int,
wk: WakuKademlia, interval: Duration, minMixPeers: int
) {.async: (raises: []).} =
info "extended kademlia discovery loop started", interval = interval

View File

@ -188,7 +188,10 @@ proc setupProtocols(
),
node.peerManager,
getMixNodePoolSize = proc(): int {.gcsafe, raises: [].} =
if node.wakuMix.isNil(): 0 else: node.getMixNodePoolSize(),
if node.wakuMix.isNil():
0
else:
node.getMixNodePoolSize(),
isNodeStarted = proc(): bool {.gcsafe, raises: [].} =
node.started,
).valueOr: