Skip to content

Commit

Permalink
fix: connection_limit test change condition
Browse files Browse the repository at this point in the history
  • Loading branch information
b-zee committed Jul 20, 2023
1 parent d854d71 commit e180673
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions misc/connection-limits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,10 @@ impl NetworkBehaviour for Behaviour {
#[cfg(test)]
mod tests {
use super::*;
use libp2p_swarm::{dial_opts::DialOpts, DialError, ListenError, Swarm, SwarmEvent};
use libp2p_swarm::{
dial_opts::{DialOpts, PeerCondition},
DialError, ListenError, Swarm, SwarmEvent,
};
use libp2p_swarm_test::SwarmExt;
use quickcheck::*;

Expand All @@ -387,14 +390,20 @@ mod tests {
network
.dial(
DialOpts::peer_id(target)
.condition(PeerCondition::Disconnected)
.addresses(vec![addr.clone()])
.build(),
)
.expect("Unexpected connection limit.");
}

match network
.dial(DialOpts::peer_id(target).addresses(vec![addr]).build())
.dial(
DialOpts::peer_id(target)
.condition(PeerCondition::Disconnected)
.addresses(vec![addr])
.build(),
)
.expect_err("Unexpected dialing success.")
{
DialError::Denied { cause } => {
Expand Down

0 comments on commit e180673

Please sign in to comment.