Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
divagant-martian committed Jul 25, 2023
1 parent 1232e6e commit 28e4ecf
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions beacon_node/lighthouse_network/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1469,14 +1469,24 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
connection_id: _,
} => {
let error_repr = match error {
libp2p::swarm::ListenError::Aborted => "incoming connection aborted".to_string(),
libp2p::swarm::ListenError::WrongPeerId { obtained, endpoint } => format!("wrong peer id, obtained {obtained}, endpoint {endpoint:?}"),
libp2p::swarm::ListenError::LocalPeerId { endpoint } => format!("dialing local peer id {endpoint:?}"),
libp2p::swarm::ListenError::Denied { cause } => format!("connection was denied with cause {cause}"),
libp2p::swarm::ListenError::Transport(t) => {
match t {
libp2p::TransportError::MultiaddrNotSupported(m) => format!("transport error: multiaddr not supported: {m}"),
libp2p::TransportError::Other(e) => format!("transport error: other: {e}"),
libp2p::swarm::ListenError::Aborted => {
"incoming connection aborted".to_string()
}
libp2p::swarm::ListenError::WrongPeerId { obtained, endpoint } => {
format!("wrong peer id, obtained {obtained}, endpoint {endpoint:?}")
}
libp2p::swarm::ListenError::LocalPeerId { endpoint } => {
format!("dialing local peer id {endpoint:?}")
}
libp2p::swarm::ListenError::Denied { cause } => {
format!("connection was denied with cause {cause}")
}
libp2p::swarm::ListenError::Transport(t) => match t {
libp2p::TransportError::MultiaddrNotSupported(m) => {
format!("transport error: multiaddr not supported: {m}")
}
libp2p::TransportError::Other(e) => {
format!("transport error: other: {e}")
}
},
};
Expand Down Expand Up @@ -1551,4 +1561,4 @@ impl<AppReqId: ReqId, TSpec: EthSpec> Network<AppReqId, TSpec> {
pub async fn next_event(&mut self) -> NetworkEvent<AppReqId, TSpec> {
futures::future::poll_fn(|cx| self.poll_network(cx)).await
}
}
}

0 comments on commit 28e4ecf

Please sign in to comment.