refactor(plaintext): rename symbols to follow naming convention

Related: #2217.

Pull-Request: #4535.
This commit is contained in:
Thomas Eizinger
2023-09-28 05:42:45 +10:00
committed by GitHub
parent f6b5a1376a
commit fffd47b69f
13 changed files with 98 additions and 102 deletions

View File

@ -25,7 +25,7 @@ use libp2p_core::{
multiaddr::Protocol, transport::MemoryTransport, upgrade::Version, Multiaddr, Transport,
};
use libp2p_identity::{Keypair, PeerId};
use libp2p_plaintext::PlainText2Config;
use libp2p_plaintext as plaintext;
use libp2p_swarm::dial_opts::PeerCondition;
use libp2p_swarm::{
dial_opts::DialOpts, NetworkBehaviour, Swarm, SwarmBuilder, SwarmEvent, THandlerErr,
@ -41,8 +41,8 @@ pub trait SwarmExt {
/// Create a new [`Swarm`] with an ephemeral identity.
///
/// The swarm will use a [`MemoryTransport`] together with [`PlainText2Config`] authentication layer and
/// yamux as the multiplexer. However, these details should not be relied upon by the test
/// The swarm will use a [`MemoryTransport`] together with a [`plaintext::Config`] authentication layer and
/// [`yamux::Config`] as the multiplexer. However, these details should not be relied upon by the test
/// and may change at any time.
fn new_ephemeral(behaviour_fn: impl FnOnce(Keypair) -> Self::NB) -> Self
where
@ -211,9 +211,7 @@ where
let transport = MemoryTransport::default()
.or_transport(libp2p_tcp::async_io::Transport::default())
.upgrade(Version::V1)
.authenticate(PlainText2Config {
local_public_key: identity.public(),
})
.authenticate(plaintext::Config::new(&identity))
.multiplex(yamux::Config::default())
.timeout(Duration::from_secs(20))
.boxed();