mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 05:21:08 +00:00
Upgrade tokio to 1.22.0 and replace async-std with tokio (#12646)
* Replace deprecated libp2p feature specs with correct ones * Bump tokio to 1.21.2 * Replace async-std libp2p primitives with tokio ones * minor: rustfmt * Fix TestNet to run initialization in the tokio context * Convert telemetry test from async-std to tokio * Convert notifications tests from async-std to tokio * Convert chain sync tests from async-std to tokio * Ditch async-std completely * Make executor mandatory * Bump tokio to 1.22.0 * minor: rustfmt * Explicitly use tokio runtime in tests * Move more tests to explicit tokio runtime * Explicitly set multithreaded runtime in tokio test * minor: rustfmt * minor: fix comment * Replace async-std with tokio in MMR tests
This commit is contained in:
@@ -64,7 +64,7 @@ use libp2p::{
|
||||
GetClosestPeersError, Kademlia, KademliaBucketInserts, KademliaConfig, KademliaEvent,
|
||||
QueryId, QueryResult, Quorum, Record,
|
||||
},
|
||||
mdns::{Mdns, MdnsConfig, MdnsEvent},
|
||||
mdns::{MdnsConfig, MdnsEvent, TokioMdns},
|
||||
multiaddr::Protocol,
|
||||
swarm::{
|
||||
behaviour::toggle::{Toggle, ToggleIntoConnectionHandler},
|
||||
@@ -235,7 +235,7 @@ impl DiscoveryConfig {
|
||||
allow_private_ipv4,
|
||||
discovery_only_if_under_num,
|
||||
mdns: if enable_mdns {
|
||||
match Mdns::new(MdnsConfig::default()) {
|
||||
match TokioMdns::new(MdnsConfig::default()) {
|
||||
Ok(mdns) => Some(mdns),
|
||||
Err(err) => {
|
||||
warn!(target: "sub-libp2p", "Failed to initialize mDNS: {:?}", err);
|
||||
@@ -266,7 +266,7 @@ pub struct DiscoveryBehaviour {
|
||||
/// it's always enabled in `NetworkWorker::new()`.
|
||||
kademlia: Toggle<Kademlia<MemoryStore>>,
|
||||
/// Discovers nodes on the local network.
|
||||
mdns: Option<Mdns>,
|
||||
mdns: Option<TokioMdns>,
|
||||
/// Stream that fires when we need to perform the next random Kademlia query. `None` if
|
||||
/// random walking is disabled.
|
||||
next_kad_random_query: Option<Delay>,
|
||||
|
||||
Reference in New Issue
Block a user