Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alrevuelta committed Jun 30, 2023
1 parent 864459f commit 30f1865
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/v2/test_peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ procSuite "Peer Manager":
.withMaxConnections(5)
.build(),
maxFailedAttempts = 1,
maxRelayPeers = 5,
maxRelayPeers = some(5),
storage = nil)

# Create 15 peers and add them to the peerstore
Expand Down Expand Up @@ -660,7 +660,7 @@ procSuite "Peer Manager":
initialBackoffInSec = 1, # with InitialBackoffInSec = 1 backoffs are: 1, 2, 4, 8secs.
backoffFactor = 2,
maxFailedAttempts = 10,
maxRelayPeers = 5,
maxRelayPeers = some(5),
storage = nil)
var p1: PeerId
require p1.init("QmeuZJbXrszW2jdT7GdduSjQskPU3S7vvGWKtKgDfkDvW" & "1")
Expand Down Expand Up @@ -709,7 +709,7 @@ procSuite "Peer Manager":
.withPeerStore(10)
.withMaxConnections(5)
.build(),
maxRelayPeers = 5,
maxRelayPeers = some(5),
maxFailedAttempts = 150,
storage = nil)

Expand All @@ -721,7 +721,7 @@ procSuite "Peer Manager":
.withMaxConnections(5)
.build(),
maxFailedAttempts = 10,
maxRelayPeers = 5,
maxRelayPeers = some(5),
storage = nil)

let pm = PeerManager.new(
Expand All @@ -730,7 +730,7 @@ procSuite "Peer Manager":
.withMaxConnections(5)
.build(),
maxFailedAttempts = 5,
maxRelayPeers = 5,
maxRelayPeers = some(5),
storage = nil)

asyncTest "colocationLimit is enforced by pruneConnsByIp()":
Expand Down
2 changes: 1 addition & 1 deletion waku/v2/node/peer_manager/peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ proc onPeerEvent(pm: PeerManager, peerId: PeerId, event: PeerEvent) {.async.} =

proc new*(T: type PeerManager,
switch: Switch,
maxRelayPeers: Option[int],
maxRelayPeers: Option[int] = none(int),
storage: PeerStorage = nil,
initialBackoffInSec = InitialBackoffInSec,
backoffFactor = BackoffFactor,
Expand Down

0 comments on commit 30f1865

Please sign in to comment.