Skip to content

Commit

Permalink
fixup! Revise naming of libp2p-ping symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Sep 3, 2021
1 parent a901894 commit 5557fbc
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions protocols/relay/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use libp2p_core::transport::{MemoryTransport, Transport, TransportError};
use libp2p_core::{identity, upgrade, PeerId};
use libp2p_identify::{Identify, IdentifyConfig, IdentifyEvent, IdentifyInfo};
use libp2p_kad::{GetClosestPeersOk, Kademlia, KademliaEvent, QueryResult};
use libp2p_ping;
use libp2p_plaintext::PlainText2Config;
use libp2p_relay::{Relay, RelayConfig};
use libp2p_swarm::protocols_handler::KeepAlive;
Expand Down Expand Up @@ -174,7 +173,7 @@ fn src_connect_to_dst_listening_via_relay() {
// Source Node waiting for Ping from Destination Node via Relay.
loop {
match src_swarm.select_next_some().await {
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
peer,
result: Ok(_),
})) => {
Expand Down Expand Up @@ -249,7 +248,7 @@ fn src_connect_to_dst_not_listening_via_active_relay() {
// Source Node waiting for Ping from Destination Node via Relay.
loop {
match src_swarm.select_next_some().await {
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
peer,
result: Ok(_),
})) => {
Expand Down Expand Up @@ -337,7 +336,7 @@ fn src_connect_to_dst_via_established_connection_to_relay() {
// Source Node waiting for Ping from Destination Node via Relay.
loop {
match src_swarm.select_next_some().await {
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
peer,
result: Ok(_),
})) => {
Expand Down Expand Up @@ -690,7 +689,7 @@ fn firewalled_src_discover_firewalled_dst_via_kad_and_connect_to_dst_via_routabl
// Source Node waiting for Ping from Destination Node via Relay.
loop {
match src_swarm.select_next_some().await {
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
peer,
result: Ok(_),
})) => {
Expand Down Expand Up @@ -1019,7 +1018,7 @@ fn yield_incoming_connection_through_correct_listener() {
if address == relay_1_addr_incl_circuit
|| address == relay_2_addr_incl_circuit
|| address == dst_addr => {}
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
peer,
result: Ok(_),
})) => {
Expand Down Expand Up @@ -1132,7 +1131,7 @@ fn yield_incoming_connection_through_correct_listener() {
#[behaviour(out_event = "CombinedEvent", poll_method = "poll")]
struct CombinedBehaviour {
relay: Relay,
ping: Ping,
ping: ping::Behaviour,
kad: Kademlia<MemoryStore>,
identify: Identify,

Expand All @@ -1143,7 +1142,7 @@ struct CombinedBehaviour {
#[derive(Debug)]
enum CombinedEvent {
Kad(KademliaEvent),
Ping(PingEvent),
Ping(ping::Event),
}

impl CombinedBehaviour {
Expand All @@ -1161,8 +1160,8 @@ impl CombinedBehaviour {
}
}

impl NetworkBehaviourEventProcess<PingEvent> for CombinedBehaviour {
fn inject_event(&mut self, event: PingEvent) {
impl NetworkBehaviourEventProcess<ping::Event> for CombinedBehaviour {
fn inject_event(&mut self, event: ping::Event) {
self.events.push(CombinedEvent::Ping(event));
}
}
Expand Down Expand Up @@ -1288,7 +1287,7 @@ fn build_swarm(reachability: Reachability, relay_mode: RelayMode) -> Swarm<Combi

let combined_behaviour = CombinedBehaviour {
relay: relay_behaviour,
ping: Ping::new(Config::new().with_interval(Duration::from_millis(100))),
ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_millis(100))),
kad: Kademlia::new(
local_peer_id.clone(),
MemoryStore::new(local_peer_id.clone()),
Expand Down

0 comments on commit 5557fbc

Please sign in to comment.