mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 04:41:02 +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:
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
[dependencies]
|
||||
chrono = "0.4.19"
|
||||
futures = "0.3.21"
|
||||
libp2p = { version = "0.49.0", default-features = false, features = ["dns-async-std", "tcp-async-io", "wasm-ext", "websocket"] }
|
||||
libp2p = { version = "0.49.0", default-features = false, features = ["dns", "tcp", "tokio", "wasm-ext", "websocket"] }
|
||||
log = "0.4.17"
|
||||
parking_lot = "0.12.1"
|
||||
pin-project = "1.0.12"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use futures::{
|
||||
executor::block_on,
|
||||
prelude::*,
|
||||
ready,
|
||||
task::{Context, Poll},
|
||||
@@ -31,8 +30,8 @@ const CONNECT_TIMEOUT: Duration = Duration::from_secs(20);
|
||||
|
||||
pub(crate) fn initialize_transport() -> Result<WsTrans, io::Error> {
|
||||
let transport = {
|
||||
let tcp_transport = libp2p::tcp::TcpTransport::new(libp2p::tcp::GenTcpConfig::new());
|
||||
let inner = block_on(libp2p::dns::DnsConfig::system(tcp_transport))?;
|
||||
let tcp_transport = libp2p::tcp::TokioTcpTransport::new(libp2p::tcp::GenTcpConfig::new());
|
||||
let inner = libp2p::dns::TokioDnsConfig::system(tcp_transport)?;
|
||||
libp2p::websocket::framed::WsConfig::new(inner).and_then(|connec, _| {
|
||||
let connec = connec
|
||||
.with(|item| {
|
||||
|
||||
Reference in New Issue
Block a user