mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 01:51:23 +00:00
feat(swarm): enforce creation of Swarm
via SwarmBuilder
Mark constructors `Swarm::with_X_executor` as deprecated. Move the deprecated functionality to `SwarmBuilder::with_X_executor` Use `SwarmBuilder` throughout. Resolves #3186. Resolves #3107. Pull-Request: #3588.
This commit is contained in:
@ -26,7 +26,7 @@ use libp2p_identity as identity;
|
||||
use libp2p_identity::PeerId;
|
||||
use libp2p_plaintext::PlainText2Config;
|
||||
use libp2p_relay as relay;
|
||||
use libp2p_swarm::{NetworkBehaviour, Swarm, SwarmEvent};
|
||||
use libp2p_swarm::{NetworkBehaviour, Swarm, SwarmBuilder, SwarmEvent};
|
||||
use libp2p_swarm_test::SwarmExt as _;
|
||||
use std::time::Duration;
|
||||
|
||||
@ -124,7 +124,7 @@ fn build_client() -> Swarm<Client> {
|
||||
.multiplex(libp2p_yamux::YamuxConfig::default())
|
||||
.boxed();
|
||||
|
||||
Swarm::without_executor(
|
||||
SwarmBuilder::without_executor(
|
||||
transport,
|
||||
Client {
|
||||
relay: behaviour,
|
||||
@ -132,6 +132,7 @@ fn build_client() -> Swarm<Client> {
|
||||
},
|
||||
local_peer_id,
|
||||
)
|
||||
.build()
|
||||
}
|
||||
|
||||
#[derive(NetworkBehaviour)]
|
||||
|
Reference in New Issue
Block a user