diff --git a/crates/net/network-api/Cargo.toml b/crates/net/network-api/Cargo.toml index 90581bca7..92b553096 100644 --- a/crates/net/network-api/Cargo.toml +++ b/crates/net/network-api/Cargo.toml @@ -18,4 +18,4 @@ serde = { version = "1.0", features = ["derive"] } # misc async-trait = "0.1" thiserror = "1.0.37" -tokio = { version = "1.21.2", features = ["sync"] } \ No newline at end of file +tokio = { version = "1.21.2", features = ["sync"] } diff --git a/crates/net/network/src/session/handle.rs b/crates/net/network/src/session/handle.rs index d3b2a8a2b..e905cfe8e 100644 --- a/crates/net/network/src/session/handle.rs +++ b/crates/net/network/src/session/handle.rs @@ -65,19 +65,18 @@ impl ActiveSessionHandle { } /// Info about an active peer session. -#[derive(Debug)] -#[allow(unused)] +#[derive(Debug, Clone)] pub struct PeerInfo { /// Announced capabilities of the peer - pub(crate) capabilities: Arc, + pub capabilities: Arc, /// The identifier of the remote peer - pub(crate) remote_id: PeerId, + pub remote_id: PeerId, /// The client's name and version - pub(crate) client_version: String, + pub client_version: String, /// The address we're connected to - pub(crate) remote_addr: SocketAddr, + pub remote_addr: SocketAddr, /// The direction of the session - pub(crate) direction: Direction, + pub direction: Direction, } /// Events a pending session can produce. diff --git a/crates/net/network/src/session/mod.rs b/crates/net/network/src/session/mod.rs index a9f1360b9..2490bc54b 100644 --- a/crates/net/network/src/session/mod.rs +++ b/crates/net/network/src/session/mod.rs @@ -595,8 +595,8 @@ pub(crate) enum PendingSessionHandshakeError { } /// The direction of the connection. -#[derive(Debug, Copy, Clone)] -pub(crate) enum Direction { +#[derive(Debug, Copy, Clone, PartialEq, Eq)] +pub enum Direction { /// Incoming connection. Incoming, /// Outgoing connection to a specific node.