Update to 2024 edition (#2001)

* Update to 2024 edition

* Update to 2024 edition; fmt, use<> and remove refs

* async functions
This commit is contained in:
James Wilson
2025-05-09 16:12:18 +01:00
committed by GitHub
parent 98c1d153b6
commit 23c62f3d5d
120 changed files with 399 additions and 322 deletions
@@ -4,8 +4,8 @@
pub(crate) use crate::{node_runtime, utils::TestNodeProcess};
use subxt::client::OnlineClient;
use subxt::SubstrateConfig;
use subxt::client::OnlineClient;
use super::node_proc::RpcClientKind;
@@ -9,8 +9,8 @@ use std::time::Duration;
use substrate_runner::SubstrateNode;
use subxt::backend::rpc::reconnecting_rpc_client::{ExponentialBackoff, RpcClientBuilder};
use subxt::{
backend::{chain_head, legacy, rpc},
Config, OnlineClient,
backend::{chain_head, legacy, rpc},
};
// The URL that we'll connect to for our tests comes from SUBXT_TEXT_HOST env var,
@@ -62,7 +62,7 @@ where
pub async fn restart(mut self) -> Self {
tokio::task::spawn_blocking(move || {
if let Some(ref mut proc) = &mut self.proc {
if let Some(proc) = &mut self.proc {
proc.restart().unwrap();
}
self
@@ -3,8 +3,8 @@
// see LICENSE for license details.
use subxt::{
backend::StreamOf, blocks::Block, client::OnlineClientT, Config, Error, OnlineClient,
SubstrateConfig,
Config, Error, OnlineClient, SubstrateConfig, backend::StreamOf, blocks::Block,
client::OnlineClientT,
};
/// Wait for blocks to be produced before running tests. Specifically, we
@@ -34,7 +34,7 @@ pub async fn wait_for_number_of_blocks<C: Config>(
pub async fn consume_initial_blocks(
blocks: &mut StreamOf<Result<Block<SubstrateConfig, OnlineClient<SubstrateConfig>>, Error>>,
) {
use tokio::time::{interval_at, Duration, Instant};
use tokio::time::{Duration, Instant, interval_at};
const MAX_DURATION: Duration = Duration::from_millis(200);
let mut now = interval_at(Instant::now() + MAX_DURATION, MAX_DURATION);