fix: replace limit by peerLimit

This commit is contained in:
Ludovic Chenut 2024-10-03 17:15:13 +02:00
parent 4f3df474cd
commit f6d1530877
No known key found for this signature in database
GPG Key ID: D9A59B1907F1D50C
2 changed files with 2 additions and 3 deletions

View File

@ -558,7 +558,7 @@ proc requestLocally*(rdv: RendezVous, ns: string): seq[PeerRecord] =
@[]
proc request*(
rdv: RendezVous, ns: string, limit: uint64 = DiscoverLimit, peers: seq[PeerId]
rdv: RendezVous, ns: string, peerLimit: uint64 = DiscoverLimit, peers: seq[PeerId]
): Future[seq[PeerRecord]] {.async.} =
## This async procedure discovers and returns peers for a given namespace
## by sending requests and processing responses. It limits the number of
@ -566,6 +566,7 @@ proc request*(
##
var
s: Table[PeerId, (PeerRecord, Register)]
limit = peerLimit
d = Discover(ns: ns)
if limit > DiscoverLimit:

View File

@ -130,8 +130,6 @@ suite "RendezVous":
switch = createSwitch(rdv)
expect RendezVousError:
discard await rdv.request("A".repeat(300))
expect RendezVousError:
discard await rdv.request("A", -1)
expect RendezVousError:
discard await rdv.request("A", 3000)
expect RendezVousError: