Skip to content

Commit

Permalink
Implement default for rendezvous point behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
rishflab committed Oct 14, 2021
1 parent a42484f commit a0df789
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions swap/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ mod tests {
}

async fn setup_rendezvous_point() -> (Multiaddr, PeerId) {
let mut rendezvous_node = new_swarm(|_, _| RendezvousPointBehaviour {
rendezvous: rendezvous::server::Behaviour::new(rendezvous::server::Config::default()),
ping: Default::default(),
});
let mut rendezvous_node = new_swarm(|_, _| RendezvousPointBehaviour::default());
let rendezvous_address = rendezvous_node.listen_on_tcp_localhost().await;
let rendezvous_peer_id = *rendezvous_node.local_peer_id();

Expand Down Expand Up @@ -175,4 +172,15 @@ mod tests {
impl NetworkBehaviourEventProcess<libp2p::ping::PingEvent> for RendezvousPointBehaviour {
fn inject_event(&mut self, _: libp2p::ping::PingEvent) {}
}

impl Default for RendezvousPointBehaviour {
fn default() -> Self {
RendezvousPointBehaviour {
rendezvous: rendezvous::server::Behaviour::new(
rendezvous::server::Config::default(),
),
ping: Default::default(),
}
}
}
}

0 comments on commit a0df789

Please sign in to comment.