Skip to content

Commit

Permalink
Fix CI checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhan-simsek-iota committed Dec 27, 2024
1 parent a9f6f82 commit 2abb99e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions consensus/core/src/network/tonic_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,19 +932,19 @@ impl<S: NetworkService> NetworkManager<S> for TonicManager {
}
}

/// Attempts to convert a multiaddr of the form `/[ip4,ip6,dns]/{}/udp/{port}`
/// Attempts to convert a multiaddr of the form `/[ip4,ip6,dns]/{}/[udp,tcp]/{port}`
/// into a host:port string.
fn to_host_port_str(addr: &Multiaddr) -> Result<String, &'static str> {
let mut iter = addr.iter();

match (iter.next(), iter.next()) {
(Some(Protocol::Ip4(ipaddr)), Some(Protocol::Udp(port))) => {
(Some(Protocol::Ip4(ipaddr)), Some(Protocol::Udp(port) | Protocol::Tcp(port))) => {
Ok(format!("{}:{}", ipaddr, port))
}
(Some(Protocol::Ip6(ipaddr)), Some(Protocol::Udp(port))) => {
(Some(Protocol::Ip6(ipaddr)), Some(Protocol::Udp(port) | Protocol::Tcp(port))) => {
Ok(format!("{}:{}", ipaddr, port))
}
(Some(Protocol::Dns(hostname)), Some(Protocol::Udp(port))) => {
(Some(Protocol::Dns(hostname)), Some(Protocol::Udp(port) | Protocol::Tcp(port))) => {
Ok(format!("{}:{}", hostname, port))
}

Expand Down
2 changes: 1 addition & 1 deletion crates/iota-network-stack/src/multiaddr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{
};

pub use ::multiaddr::{Error, Protocol};
use eyre::{eyre, Result};
use eyre::{Result, eyre};
use tracing::error;

#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
Expand Down

0 comments on commit 2abb99e

Please sign in to comment.