@@ -38,17 +38,6 @@ use libp2p_swarm::{
3838pub trait SwarmExt {
3939 type NB : NetworkBehaviour ;
4040
41- /// Create a new [`Swarm`] with an ephemeral identity and the `async-std` runtime.
42- ///
43- /// The swarm will use a [`libp2p_core::transport::MemoryTransport`] together with a
44- /// [`libp2p_plaintext::Config`] authentication layer and [`libp2p_yamux::Config`] as the
45- /// multiplexer. However, these details should not be relied
46- /// upon by the test and may change at any time.
47- #[ cfg( feature = "async-std" ) ]
48- fn new_ephemeral ( behaviour_fn : impl FnOnce ( libp2p_identity:: Keypair ) -> Self :: NB ) -> Self
49- where
50- Self : Sized ;
51-
5241 /// Create a new [`Swarm`] with an ephemeral identity and the `tokio` runtime.
5342 ///
5443 /// The swarm will use a [`libp2p_core::transport::MemoryTransport`] together with a
@@ -223,33 +212,6 @@ where
223212{
224213 type NB = B ;
225214
226- #[ cfg( feature = "async-std" ) ]
227- fn new_ephemeral ( behaviour_fn : impl FnOnce ( libp2p_identity:: Keypair ) -> Self :: NB ) -> Self
228- where
229- Self : Sized ,
230- {
231- use libp2p_core:: { transport:: MemoryTransport , upgrade:: Version , Transport as _} ;
232- use libp2p_identity:: Keypair ;
233-
234- let identity = Keypair :: generate_ed25519 ( ) ;
235- let peer_id = PeerId :: from ( identity. public ( ) ) ;
236-
237- let transport = MemoryTransport :: default ( )
238- . or_transport ( libp2p_tcp:: async_io:: Transport :: default ( ) )
239- . upgrade ( Version :: V1 )
240- . authenticate ( libp2p_plaintext:: Config :: new ( & identity) )
241- . multiplex ( libp2p_yamux:: Config :: default ( ) )
242- . timeout ( Duration :: from_secs ( 20 ) )
243- . boxed ( ) ;
244-
245- Swarm :: new (
246- transport,
247- behaviour_fn ( identity) ,
248- peer_id,
249- libp2p_swarm:: Config :: with_async_std_executor ( ) ,
250- )
251- }
252-
253215 #[ cfg( feature = "tokio" ) ]
254216 fn new_ephemeral_tokio ( behaviour_fn : impl FnOnce ( libp2p_identity:: Keypair ) -> Self :: NB ) -> Self
255217 where
0 commit comments