fix(core): remove UpgradeError from public API

Not making this private was an oversight from an earlier refactoring.

Related: #3915.

Pull-Request: #4012.
This commit is contained in:
Thomas Eizinger
2023-06-05 17:16:04 +02:00
committed by GitHub
parent 68af6669ab
commit 1d3db7d9a8
3 changed files with 5 additions and 9 deletions

View File

@ -1776,20 +1776,18 @@ fn p2p_addr(peer: Option<PeerId>, addr: Multiaddr) -> Result<Multiaddr, Multiadd
mod tests {
use super::*;
use crate::test::{CallTraceBehaviour, MockBehaviour};
use either::Either;
use futures::executor::block_on;
use futures::executor::ThreadPool;
use futures::{executor, future};
use libp2p_core::multiaddr::multiaddr;
use libp2p_core::transport::memory::MemoryTransportError;
use libp2p_core::transport::TransportEvent;
use libp2p_core::Endpoint;
use libp2p_core::{multiaddr, transport, upgrade};
use libp2p_core::{Endpoint, UpgradeError};
use libp2p_identity as identity;
use libp2p_plaintext as plaintext;
use libp2p_yamux as yamux;
use quickcheck::*;
use void::Void;
// Test execution state.
// Connection => Disconnecting => Connecting.
@ -2374,15 +2372,13 @@ mod tests {
"/ip4/127.0.0.1/tcp/80".parse().unwrap(),
TransportError::Other(io::Error::new(
io::ErrorKind::Other,
Either::<_, Void>::Left(Either::<Void, _>::Right(UpgradeError::Apply(
MemoryTransportError::Unreachable,
))),
MemoryTransportError::Unreachable,
)),
)]);
let string = format!("{error}");
// Unfortunately, we have some "empty" errors that lead to multiple colons without text but that is the best we can do.
assert_eq!("Failed to negotiate transport protocol(s): [(/ip4/127.0.0.1/tcp/80: : Handshake failed: No listener on the given port.)]", string)
assert_eq!("Failed to negotiate transport protocol(s): [(/ip4/127.0.0.1/tcp/80: : No listener on the given port.)]", string)
}
}