Skip to content

Commit

Permalink
Fix issues after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
umgefahren committed Aug 3, 2024
1 parent 73584cd commit 5fb6715
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 20 deletions.
6 changes: 4 additions & 2 deletions misc/server/src/behaviour.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(deprecated)]

use libp2p::autonat;
use libp2p::identify;
use libp2p::kad;
Expand All @@ -24,7 +26,7 @@ pub(crate) struct Behaviour {
ping: ping::Behaviour,
identify: identify::Behaviour,
pub(crate) kademlia: Toggle<kad::Behaviour<kad::store::MemoryStore>>,
autonat: Toggle<autonat::Behaviour>,
autonat: Toggle<autonat::v1::Behaviour>,
}

impl Behaviour {
Expand Down Expand Up @@ -57,7 +59,7 @@ impl Behaviour {
.into();

let autonat = if enable_autonat {
Some(autonat::Behaviour::new(
Some(autonat::v1::Behaviour::new(
PeerId::from(pub_key.clone()),
Default::default(),
))
Expand Down
7 changes: 2 additions & 5 deletions protocols/autonat/src/v2/server/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ use std::{

use crate::v2::server::handler::dial_request::DialBackStatus;
use either::Either;
use libp2p_core::{
transport::{PortUse, TransportError},
Endpoint, Multiaddr,
};
use libp2p_core::{transport::PortUse, Endpoint, Multiaddr};
use libp2p_identity::PeerId;
use libp2p_swarm::dial_opts::PeerCondition;
use libp2p_swarm::{
dial_opts::DialOpts, dummy, ConnectionDenied, ConnectionHandler, ConnectionId, DialFailure,
FromSwarm, NetworkBehaviour, ToSwarm,
};
use libp2p_swarm::{dial_opts::PeerCondition, DialError};
use rand_core::{OsRng, RngCore};

use crate::v2::server::handler::{
Expand Down
9 changes: 0 additions & 9 deletions protocols/autonat/src/v2/server/handler/dial_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ pub(crate) enum DialBackStatus {
DialErr,
/// Failure during dial back
DialBackErr,
/// Unreachable
Unreachable,
}

#[derive(Debug)]
Expand Down Expand Up @@ -187,13 +185,6 @@ impl From<HandleFail> for DialResponse {
dial_status: match result {
Err(DialBackStatus::DialErr) => DialStatus::E_DIAL_ERROR,
Err(DialBackStatus::DialBackErr) => DialStatus::E_DIAL_BACK_ERROR,
Err(DialBackStatus::Unreachable) => {
return Self {
status: ResponseStatus::E_DIAL_REFUSED,
addr_idx: 0,
dial_status: DialStatus::UNUSED,
}
}
Ok(()) => DialStatus::OK,
},
},
Expand Down
4 changes: 0 additions & 4 deletions swarm/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ use libp2p_core::{
transport::{ListenerId, PortUse},
ConnectedPoint, Endpoint, Multiaddr,
};
use libp2p_core::{
transport::{ListenerId, PortUse},
ConnectedPoint, Endpoint, Multiaddr,
};
use libp2p_identity::PeerId;
use std::{task::Context, task::Poll};

Expand Down

0 comments on commit 5fb6715

Please sign in to comment.