Skip to content

Commit e588bde

Browse files
fixup! Revise naming of libp2p-ping symbols
1 parent a901894 commit e588bde

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

protocols/relay/tests/lib.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use libp2p_core::transport::{MemoryTransport, Transport, TransportError};
3131
use libp2p_core::{identity, upgrade, PeerId};
3232
use libp2p_identify::{Identify, IdentifyConfig, IdentifyEvent, IdentifyInfo};
3333
use libp2p_kad::{GetClosestPeersOk, Kademlia, KademliaEvent, QueryResult};
34-
use libp2p_ping;
34+
use libp2p_ping as ping;
3535
use libp2p_plaintext::PlainText2Config;
3636
use libp2p_relay::{Relay, RelayConfig};
3737
use libp2p_swarm::protocols_handler::KeepAlive;
@@ -174,7 +174,7 @@ fn src_connect_to_dst_listening_via_relay() {
174174
// Source Node waiting for Ping from Destination Node via Relay.
175175
loop {
176176
match src_swarm.select_next_some().await {
177-
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
177+
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
178178
peer,
179179
result: Ok(_),
180180
})) => {
@@ -249,7 +249,7 @@ fn src_connect_to_dst_not_listening_via_active_relay() {
249249
// Source Node waiting for Ping from Destination Node via Relay.
250250
loop {
251251
match src_swarm.select_next_some().await {
252-
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
252+
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
253253
peer,
254254
result: Ok(_),
255255
})) => {
@@ -337,7 +337,7 @@ fn src_connect_to_dst_via_established_connection_to_relay() {
337337
// Source Node waiting for Ping from Destination Node via Relay.
338338
loop {
339339
match src_swarm.select_next_some().await {
340-
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
340+
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
341341
peer,
342342
result: Ok(_),
343343
})) => {
@@ -690,7 +690,7 @@ fn firewalled_src_discover_firewalled_dst_via_kad_and_connect_to_dst_via_routabl
690690
// Source Node waiting for Ping from Destination Node via Relay.
691691
loop {
692692
match src_swarm.select_next_some().await {
693-
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
693+
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
694694
peer,
695695
result: Ok(_),
696696
})) => {
@@ -1019,7 +1019,7 @@ fn yield_incoming_connection_through_correct_listener() {
10191019
if address == relay_1_addr_incl_circuit
10201020
|| address == relay_2_addr_incl_circuit
10211021
|| address == dst_addr => {}
1022-
SwarmEvent::Behaviour(CombinedEvent::Ping(PingEvent {
1022+
SwarmEvent::Behaviour(CombinedEvent::Ping(ping::Event {
10231023
peer,
10241024
result: Ok(_),
10251025
})) => {
@@ -1132,7 +1132,7 @@ fn yield_incoming_connection_through_correct_listener() {
11321132
#[behaviour(out_event = "CombinedEvent", poll_method = "poll")]
11331133
struct CombinedBehaviour {
11341134
relay: Relay,
1135-
ping: Ping,
1135+
ping: ping::Behaviour,
11361136
kad: Kademlia<MemoryStore>,
11371137
identify: Identify,
11381138

@@ -1143,7 +1143,7 @@ struct CombinedBehaviour {
11431143
#[derive(Debug)]
11441144
enum CombinedEvent {
11451145
Kad(KademliaEvent),
1146-
Ping(PingEvent),
1146+
Ping(ping::Event),
11471147
}
11481148

11491149
impl CombinedBehaviour {
@@ -1161,8 +1161,8 @@ impl CombinedBehaviour {
11611161
}
11621162
}
11631163

1164-
impl NetworkBehaviourEventProcess<PingEvent> for CombinedBehaviour {
1165-
fn inject_event(&mut self, event: PingEvent) {
1164+
impl NetworkBehaviourEventProcess<ping::Event> for CombinedBehaviour {
1165+
fn inject_event(&mut self, event: ping::Event) {
11661166
self.events.push(CombinedEvent::Ping(event));
11671167
}
11681168
}
@@ -1288,7 +1288,7 @@ fn build_swarm(reachability: Reachability, relay_mode: RelayMode) -> Swarm<Combi
12881288

12891289
let combined_behaviour = CombinedBehaviour {
12901290
relay: relay_behaviour,
1291-
ping: Ping::new(Config::new().with_interval(Duration::from_millis(100))),
1291+
ping: ping::Behaviour::new(ping::Config::new().with_interval(Duration::from_millis(100))),
12921292
kad: Kademlia::new(
12931293
local_peer_id.clone(),
12941294
MemoryStore::new(local_peer_id.clone()),

0 commit comments

Comments
 (0)