From cf0874d9a0eb1afebeae91adfc2188f36e696498 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Fri, 31 Mar 2023 16:08:11 +0100 Subject: [PATCH 01/27] new test for try-runtime tuple stuff --- frame/executive/src/lib.rs | 1 + frame/support/src/lib.rs | 6 ++-- frame/support/src/traits/hooks.rs | 58 +++++++++++++++++++++++++++++-- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/frame/executive/src/lib.rs b/frame/executive/src/lib.rs index 05f3ee4f53588..9f75f8d02bb08 100644 --- a/frame/executive/src/lib.rs +++ b/frame/executive/src/lib.rs @@ -267,6 +267,7 @@ where >::note_extrinsic(encoded); let dispatch_info = xt.get_dispatch_info(); + let r = Applyable::apply::(xt, &dispatch_info, encoded_len)?; >::note_applied_extrinsic(&r, dispatch_info); diff --git a/frame/support/src/lib.rs b/frame/support/src/lib.rs index 4e9bc32b0043b..5e8cb9b4d44b3 100644 --- a/frame/support/src/lib.rs +++ b/frame/support/src/lib.rs @@ -371,16 +371,14 @@ macro_rules! parameter_types { /// Set the value of this parameter type in the storage. /// - /// This needs to be executed in an externalities provided - /// environment. + /// This needs to be executed in an externalities provided environment. pub fn set(value: &$type) { $crate::storage::unhashed::put(&Self::key(), value); } /// Returns the value of this parameter type. /// - /// This needs to be executed in an externalities provided - /// environment. + /// This needs to be executed in an externalities provided environment. #[allow(unused)] pub fn get() -> $type { $crate::storage::unhashed::get(&Self::key()).unwrap_or_else(|| $value) diff --git a/frame/support/src/traits/hooks.rs b/frame/support/src/traits/hooks.rs index a3374d0bf537f..88378201c3e32 100644 --- a/frame/support/src/traits/hooks.rs +++ b/frame/support/src/traits/hooks.rs @@ -197,10 +197,10 @@ impl OnRuntimeUpgrade for Tuple { weight } - #[cfg(feature = "try-runtime")] /// We are executing pre- and post-checks sequentially in order to be able to test several /// consecutive migrations for the same pallet without errors. Therefore pre and post upgrade /// hooks for tuples are a noop. + #[cfg(feature = "try-runtime")] fn try_on_runtime_upgrade(checks: bool) -> Result { let mut weight = Weight::zero(); for_tuples!( #( weight = weight.saturating_add(Tuple::try_on_runtime_upgrade(checks)?); )* ); @@ -359,10 +359,64 @@ pub trait OnTimestampSet { #[cfg(test)] mod tests { use super::*; + use sp_io::TestExternalities; + + #[test] + fn on_runtime_upgrade_pre_post_executed_tuple() { + crate::parameter_types! { + pub static Pre: Vec<&'static str> = Default::default(); + pub static Post: Vec<&'static str> = Default::default(); + } + + macro_rules! impl_test_type { + ($name:ident) => { + struct $name; + impl OnRuntimeUpgrade for $name { + fn on_runtime_upgrade() -> Weight { + Default::default() + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, &'static str> { + Pre::mutate(|s| s.push(stringify!($name))); + Ok(Vec::new()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(_: Vec) -> Result<(), &'static str> { + Post::mutate(|s| s.push(stringify!($name))); + Ok(()) + } + } + }; + } + + impl_test_type!(Foo); + impl_test_type!(Bar); + impl_test_type!(Baz); + + TestExternalities::default().execute_with(|| { + Foo::try_on_runtime_upgrade(true).unwrap(); + // todo unify the API for storage parameter_types! output. + assert_eq!(Pre::take(), vec!["Foo"]); + assert_eq!(Post::take(), vec!["Foo"]); + + <(Foo, Bar, Baz)>::try_on_runtime_upgrade(true).unwrap(); + assert_eq!(Pre::take(), vec!["Foo", "Bar", "Baz"]); + assert_eq!(Post::take(), vec!["Foo", "Bar", "Baz"]); + + <((Foo, Bar), Baz)>::try_on_runtime_upgrade(true).unwrap(); + assert_eq!(Pre::take(), vec!["Foo", "Bar", "Baz"]); + assert_eq!(Post::take(), vec!["Foo", "Bar", "Baz"]); + + <(Foo, (Bar, Baz))>::try_on_runtime_upgrade(true).unwrap(); + assert_eq!(Pre::take(), vec!["Foo", "Bar", "Baz"]); + assert_eq!(Post::take(), vec!["Foo", "Bar", "Baz"]); + }); + } #[test] fn on_initialize_and_on_runtime_upgrade_weight_merge_works() { - use sp_io::TestExternalities; struct Test; impl OnInitialize for Test { From b62c68cc4445a15d13336c4e363e474af51566cb Mon Sep 17 00:00:00 2001 From: kianenigma Date: Fri, 31 Mar 2023 16:32:57 +0100 Subject: [PATCH 02/27] fix --- .../cli/src/commands/follow_chain.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/utils/frame/try-runtime/cli/src/commands/follow_chain.rs b/utils/frame/try-runtime/cli/src/commands/follow_chain.rs index 2a67d269c87f1..4ab27d4021bcc 100644 --- a/utils/frame/try-runtime/cli/src/commands/follow_chain.rs +++ b/utils/frame/try-runtime/cli/src/commands/follow_chain.rs @@ -108,10 +108,12 @@ where .or_else(|e| { if matches!(e, substrate_rpc_client::Error::ParseError(_)) { log::error!( + target: LOG_TARGET, "failed to parse the block format of remote against the local \ - codebase. The block format has changed, and follow-chain cannot run in \ - this case. Try running this command in a branch of your codebase that has \ - the same block format as the remote chain. For now, we replace the block with an empty one" + codebase. The block format has changed, and follow-chain cannot run in \ + this case. Try running this command in a branch of your codebase that + has the same block format as the remote chain. For now, we replace the \ + block with an empty one." ); } Err(rpc_err_handler(e)) @@ -148,7 +150,16 @@ where state_ext, &executor, "TryRuntime_execute_block", - (block, command.state_root_check, command.try_state.clone()).encode().as_ref(), + (block, command.state_root_check, true, command.try_state.clone()) + // ^^^^ is the fix. + // needs an integration test to make sure the payload that is build in various + // try-runtime-cli command match the trait def. We could: move `trait TryRuntime` to + // `sp-try-runtime` (or keep it where it is). provide a fake implementation of it + // here. call into that fake implementation with teh payload that we build above. + // Or, a realistic test that actually builds a wasm from substrate-node-template, + // but I don't know how to do it exactly. + .encode() + .as_ref(), full_extensions(), shared .export_proof From d1ac70310c86c0501c3063b50182202555851843 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Fri, 31 Mar 2023 21:47:25 +0400 Subject: [PATCH 03/27] remove development comment --- utils/frame/try-runtime/cli/src/commands/follow_chain.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/utils/frame/try-runtime/cli/src/commands/follow_chain.rs b/utils/frame/try-runtime/cli/src/commands/follow_chain.rs index 4ab27d4021bcc..94df52a06cbd0 100644 --- a/utils/frame/try-runtime/cli/src/commands/follow_chain.rs +++ b/utils/frame/try-runtime/cli/src/commands/follow_chain.rs @@ -151,13 +151,6 @@ where &executor, "TryRuntime_execute_block", (block, command.state_root_check, true, command.try_state.clone()) - // ^^^^ is the fix. - // needs an integration test to make sure the payload that is build in various - // try-runtime-cli command match the trait def. We could: move `trait TryRuntime` to - // `sp-try-runtime` (or keep it where it is). provide a fake implementation of it - // here. call into that fake implementation with teh payload that we build above. - // Or, a realistic test that actually builds a wasm from substrate-node-template, - // but I don't know how to do it exactly. .encode() .as_ref(), full_extensions(), From e82616863e9f4119e3063ac6a606b88ab16ed773 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Fri, 31 Mar 2023 21:48:02 +0400 Subject: [PATCH 04/27] formatting --- frame/executive/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/frame/executive/src/lib.rs b/frame/executive/src/lib.rs index 0fa029f34c264..5003920eadcb5 100644 --- a/frame/executive/src/lib.rs +++ b/frame/executive/src/lib.rs @@ -270,7 +270,6 @@ where >::note_extrinsic(encoded); let dispatch_info = xt.get_dispatch_info(); - let r = Applyable::apply::(xt, &dispatch_info, encoded_len)?; >::note_applied_extrinsic(&r, dispatch_info); From cfd0dd7304f5632eb55f9ebc7130e3f2f3651801 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Sat, 1 Apr 2023 08:30:08 +0400 Subject: [PATCH 05/27] remove todo comment --- frame/support/src/traits/hooks.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/frame/support/src/traits/hooks.rs b/frame/support/src/traits/hooks.rs index 88378201c3e32..b4a4e835efab0 100644 --- a/frame/support/src/traits/hooks.rs +++ b/frame/support/src/traits/hooks.rs @@ -397,7 +397,6 @@ mod tests { TestExternalities::default().execute_with(|| { Foo::try_on_runtime_upgrade(true).unwrap(); - // todo unify the API for storage parameter_types! output. assert_eq!(Pre::take(), vec!["Foo"]); assert_eq!(Post::take(), vec!["Foo"]); From d5d58bc62435dbf92aee1fcaf3f49b66320b413a Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 4 Apr 2023 19:17:07 +0400 Subject: [PATCH 06/27] follow-chain working test --- utils/frame/try-runtime/cli/Cargo.toml | 13 +- utils/frame/try-runtime/cli/tests/common.rs | 169 ++++++++++++++++++ .../try-runtime/cli/tests/follow_chain.rs | 122 +++++++++++++ 3 files changed, 299 insertions(+), 5 deletions(-) create mode 100644 utils/frame/try-runtime/cli/tests/common.rs create mode 100644 utils/frame/try-runtime/cli/tests/follow_chain.rs diff --git a/utils/frame/try-runtime/cli/Cargo.toml b/utils/frame/try-runtime/cli/Cargo.toml index a220289542464..b0de155940a48 100644 --- a/utils/frame/try-runtime/cli/Cargo.toml +++ b/utils/frame/try-runtime/cli/Cargo.toml @@ -45,10 +45,13 @@ serde_json = "1.0.85" zstd = { version = "0.11.2", default-features = false } [dev-dependencies] -tokio = "1.22.0" +assert_cmd = "2.0.10" +nix = "0.26.2" +regex = "1.7.3" +tempfile = "3.5.0" +tokio = { version = "1.22.0", features = ["full"] } +node-primitives = { path = "../../../../bin/node/primitives" } +futures = "0.3.28" [features] -try-runtime = [ - "sp-debug-derive/force-debug", - "frame-try-runtime/try-runtime", -] +try-runtime = ["sp-debug-derive/force-debug", "frame-try-runtime/try-runtime"] diff --git a/utils/frame/try-runtime/cli/tests/common.rs b/utils/frame/try-runtime/cli/tests/common.rs new file mode 100644 index 0000000000000..e5df00d098949 --- /dev/null +++ b/utils/frame/try-runtime/cli/tests/common.rs @@ -0,0 +1,169 @@ + +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#![cfg(unix)] + +use assert_cmd::cargo::cargo_bin; +use nix::{ + sys::signal::{kill, Signal, Signal::SIGINT}, + unistd::Pid, +}; +use node_primitives::{Hash, Header}; +use regex::Regex; +use std::{ + io::{BufRead, BufReader, Read}, + ops::{Deref, DerefMut}, + path::{Path, PathBuf}, + process::{self, Child, Command}, + time::Duration, +}; + +/// Run the given `future` and panic if the `timeout` is hit. +pub async fn run_with_timeout(timeout: Duration, future: impl futures::Future) { + tokio::time::timeout(timeout, future).await.expect("Hit timeout"); +} + +/// Wait for at least n blocks to be finalized from a specified node +pub async fn wait_n_finalized_blocks(n: usize, url: &str) { + use substrate_rpc_client::{ws_client, ChainApi}; + + let mut built_blocks = std::collections::HashSet::new(); + let mut interval = tokio::time::interval(Duration::from_secs(2)); + let rpc = ws_client(url).await.unwrap(); + + loop { + if let Ok(block) = ChainApi::<(), Hash, Header, ()>::finalized_head(&rpc).await { + built_blocks.insert(block); + if built_blocks.len() > n { + break + } + }; + interval.tick().await; + } +} + +/// Run the node for a while (3 blocks) +pub async fn run_node_for_a_while(base_path: &Path, args: &[&str]) { + run_with_timeout(Duration::from_secs(60 * 10), async move { + let mut cmd = Command::new(cargo_bin("substrate")) + .stdout(process::Stdio::piped()) + .stderr(process::Stdio::piped()) + .args(args) + .arg("-d") + .arg(base_path) + .spawn() + .unwrap(); + + let stderr = cmd.stderr.take().unwrap(); + + let mut child = KillChildOnDrop(cmd); + + let ws_url = extract_info_from_output(stderr).0.ws_url; + + // Let it produce some blocks. + wait_n_finalized_blocks(3, &ws_url).await; + + child.assert_still_running(); + + // Stop the process + child.stop(); + }) + .await +} + +pub struct KillChildOnDrop(pub Child); + +impl KillChildOnDrop { + /// Stop the child and wait until it is finished. + /// + /// Asserts if the exit status isn't success. + pub fn stop(&mut self) { + self.stop_with_signal(SIGINT); + } + + /// Same as [`Self::stop`] but takes the `signal` that is sent to stop the child. + pub fn stop_with_signal(&mut self, signal: Signal) { + kill(Pid::from_raw(self.id().try_into().unwrap()), signal).unwrap(); + assert!(self.wait().unwrap().success()); + } + + /// Asserts that the child is still running. + pub fn assert_still_running(&mut self) { + assert!(self.try_wait().unwrap().is_none(), "the process should still be running"); + } +} + +impl Drop for KillChildOnDrop { + fn drop(&mut self) { + let _ = self.0.kill(); + } +} + +impl Deref for KillChildOnDrop { + type Target = Child; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for KillChildOnDrop { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +/// Information extracted from a running node. +pub struct NodeInfo { + pub ws_url: String, + pub db_path: PathBuf, +} + +/// Extract [`NodeInfo`] from a running node by parsing its output. +/// +/// Returns the [`NodeInfo`] and all the read data. +pub fn extract_info_from_output(read: impl Read + Send) -> (NodeInfo, String) { + let mut data = String::new(); + + let ws_url = BufReader::new(read) + .lines() + .find_map(|line| { + let line = line.expect("failed to obtain next line while extracting node info"); + data.push_str(&line); + data.push_str("\n"); + + // does the line contain our port (we expect this specific output from substrate). + let sock_addr = match line.split_once("Running JSON-RPC WS server: addr=") { + None => return None, + Some((_, after)) => after.split_once(",").unwrap().0, + }; + + Some(format!("ws://{}", sock_addr)) + }) + .unwrap_or_else(|| { + eprintln!("Observed node output:\n{}", data); + panic!("We should get a WebSocket address") + }); + + // Database path is printed before the ws url! + let re = Regex::new(r"Database: .+ at (\S+)").unwrap(); + let db_path = PathBuf::from(re.captures(data.as_str()).unwrap().get(1).unwrap().as_str()); + + (NodeInfo { ws_url, db_path }, data) +} diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs new file mode 100644 index 0000000000000..2babdf200f0d1 --- /dev/null +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -0,0 +1,122 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#![cfg(unix)] + +use assert_cmd::cargo::cargo_bin; +use regex::Regex; +use std::{ + process::{self, Child, Command}, + time::Duration, +}; +use tokio::io::{AsyncBufReadExt, AsyncRead}; + +pub mod common; + +#[tokio::test] +async fn follow_chain_works() { + common::run_with_timeout(Duration::from_secs(60), async move { + /// Asynchronously reads lines from an async tokio stream and waits for + /// a pattern match. + /// + /// This function takes a readable tokio stream (e.g. from a child process `ChildStderr` or + /// `ChildStdout`) and a `Regex` pattern. It reads lines from the provided stream and checks + /// each line against the given pattern. The function returns as soon as a line matching the + /// pattern is found. + /// + /// # Arguments + /// + /// * `child_stream` - An async tokio stream, e.g. from a child process `ChildStderr` or + /// `ChildStdout`. + /// * `re` - A `Regex` pattern to search for in the stream. + /// + /// # Returns + /// + /// * `Ok(())` if a line matching the pattern is found. + /// * `Err(String)` if the stream ends without any lines matching the pattern, or if an + /// error occurs while reading the stream. + /// + /// # Example + /// + /// ``` + /// use regex::Regex; + /// use tokio::process::Command; + /// use tokio::io::AsyncRead; + /// + /// # async fn run() { + /// let child = Command::new("some-command").stderr(std::process::Stdio::piped()).spawn().unwrap(); + /// let stderr = child.stderr.unwrap(); + /// let re = Regex::new("error:").unwrap(); + /// + /// match wait_for_pattern_match_in_stream(stderr, re).await { + /// Ok(()) => println!("Error found in stderr"), + /// Err(e) => println!("Error: {}", e), + /// } + /// # } + /// ``` + async fn wait_for_stream_pattern_match(stream: R, re: Regex) -> Result<(), String> + where + R: AsyncRead + Unpin, + { + let mut stdio_reader = tokio::io::BufReader::new(stream).lines(); + while let Ok(Some(line)) = stdio_reader.next_line().await { + match re.find(line.as_str()) { + Some(_) => return Ok(()), + None => (), + } + } + Err(String::from("Stderr stream ended without any lines matching the regex.")) + } + + fn start_node() -> Child { + Command::new(cargo_bin("substrate")) + .stdout(process::Stdio::piped()) + .stderr(process::Stdio::piped()) + .args(&["--dev", "--tmp", "--ws-port=45789", "--no-hardware-benchmarks"]) + .spawn() + .unwrap() + } + + fn start_follow(ws_url: &str) -> tokio::process::Child { + tokio::process::Command::new(cargo_bin("substrate")) + .stdout(process::Stdio::piped()) + .stderr(process::Stdio::piped()) + .args(&["try-runtime", "--runtime=existing"]) + .args(&["follow-chain", format!("--uri={}", ws_url).as_str()]) + .spawn() + .unwrap() + } + + // Start a node and wait for it to begin finalizing blocks + let mut node = start_node(); + let ws_url = common::extract_info_from_output(node.stderr.take().unwrap()).0.ws_url; + common::wait_n_finalized_blocks(1, &ws_url).await; + + // Kick off the follow-chain process and wait for it to process at least 3 blocks. + let mut follow = start_follow(&ws_url); + let re = Regex::new(r#".*executed block ([3-9]|[1-9]\d+).*"#).unwrap(); + let matched = wait_for_stream_pattern_match(follow.stderr.take().unwrap(), re).await; + + // Assert that the follow-chain process has followed at least 5 blocks. + assert!(matches!(matched, Ok(_))); + + // Sanity check: node is still running + assert!(node.try_wait().unwrap().is_none()); + }) + .await; +} From 8094ba84c932b0df8f987f02f31ad339101521d2 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 4 Apr 2023 20:02:12 +0400 Subject: [PATCH 07/27] refactor common cli testing utils --- Cargo.lock | 315 +++++++++++------- bin/node/cli/Cargo.toml | 1 + bin/node/cli/tests/benchmark_block_works.rs | 2 +- bin/node/cli/tests/benchmark_pallet_works.rs | 2 - bin/node/cli/tests/check_block_works.rs | 2 +- bin/node/cli/tests/common.rs | 168 ---------- bin/node/cli/tests/export_import_flow.rs | 2 +- bin/node/cli/tests/inspect_works.rs | 2 +- bin/node/cli/tests/purge_chain_works.rs | 2 +- .../cli/tests/remember_state_pruning_works.rs | 2 +- .../tests/running_the_node_and_interrupt.rs | 2 +- bin/node/cli/tests/telemetry.rs | 2 +- bin/node/cli/tests/temp_base_path_works.rs | 2 +- test-utils/cli/Cargo.toml | 23 ++ .../common.rs => test-utils/cli/src/lib.rs | 54 ++- utils/frame/try-runtime/cli/Cargo.toml | 7 +- .../try-runtime/cli/tests/follow_chain.rs | 59 +--- 17 files changed, 292 insertions(+), 355 deletions(-) delete mode 100644 bin/node/cli/tests/common.rs create mode 100644 test-utils/cli/Cargo.toml rename utils/frame/try-runtime/cli/tests/common.rs => test-utils/cli/src/lib.rs (72%) diff --git a/Cargo.lock b/Cargo.lock index 7fd0122f3cc0f..84a99fa888415 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -203,6 +203,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstyle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" + [[package]] name = "anyhow" version = "1.0.69" @@ -294,7 +300,7 @@ checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -306,7 +312,7 @@ checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -318,7 +324,7 @@ checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -329,13 +335,14 @@ checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" [[package]] name = "assert_cmd" -version = "2.0.8" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9834fcc22e0874394a010230586367d4a3e9f11b560f469262678547e1d2575e" +checksum = "ec0b2340f55d9661d76793b2bfc2eb0e62689bd79d067a95707ea762afd5e9dd" dependencies = [ + "anstyle", "bstr", "doc-comment", - "predicates", + "predicates 3.0.2", "predicates-core", "predicates-tree", "wait-timeout", @@ -407,7 +414,7 @@ checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -418,7 +425,7 @@ checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -564,7 +571,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn", + "syn 1.0.109", ] [[package]] @@ -1046,7 +1053,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1424,7 +1431,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1509,7 +1516,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.109", ] [[package]] @@ -1526,7 +1533,7 @@ checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1550,7 +1557,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.109", ] [[package]] @@ -1561,7 +1568,7 @@ checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1587,7 +1594,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn", + "syn 1.0.109", ] [[package]] @@ -1647,7 +1654,7 @@ checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1668,7 +1675,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1678,7 +1685,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn", + "syn 1.0.109", ] [[package]] @@ -1689,7 +1696,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1782,7 +1789,7 @@ checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1833,7 +1840,7 @@ checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1959,7 +1966,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1979,7 +1986,7 @@ checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2025,6 +2032,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -2060,7 +2078,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2137,7 +2155,7 @@ checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "windows-sys 0.45.0", ] @@ -2333,7 +2351,7 @@ dependencies = [ "quote", "scale-info", "sp-arithmetic", - "syn", + "syn 1.0.109", "trybuild", ] @@ -2470,7 +2488,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2481,7 +2499,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2490,7 +2508,7 @@ version = "3.0.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2634,9 +2652,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -2649,9 +2667,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -2659,15 +2677,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -2677,9 +2695,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" @@ -2698,13 +2716,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] @@ -2720,15 +2738,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-timer" @@ -2738,9 +2756,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -3290,7 +3308,7 @@ checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3514,7 +3532,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4139,7 +4157,7 @@ checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" dependencies = [ "heck", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4374,6 +4392,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +[[package]] +name = "linux-raw-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" + [[package]] name = "lite-json" version = "0.2.0" @@ -4661,7 +4685,7 @@ dependencies = [ "fragile", "lazy_static", "mockall_derive", - "predicates", + "predicates 2.1.5", "predicates-tree", ] @@ -4674,7 +4698,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4764,7 +4788,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -4812,7 +4836,7 @@ checksum = "d232c68884c0c99810a5a4d333ef7e47689cfd0edc85efc9e54e1e6bf5212766" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -5029,6 +5053,7 @@ dependencies = [ "sp-transaction-pool", "sp-transaction-storage-proof", "substrate-build-script-utils", + "substrate-cli-test-utils", "substrate-frame-cli", "substrate-rpc-client", "tempfile", @@ -5885,7 +5910,7 @@ version = "4.0.0-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -6768,7 +6793,7 @@ dependencies = [ "proc-macro2", "quote", "sp-runtime", - "syn", + "syn 1.0.109", ] [[package]] @@ -7076,7 +7101,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7127,7 +7152,7 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi", ] @@ -7140,7 +7165,7 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "windows-sys 0.45.0", ] @@ -7229,7 +7254,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7270,7 +7295,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7426,11 +7451,23 @@ dependencies = [ "regex", ] +[[package]] +name = "predicates" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c575290b64d24745b6c57a12a31465f0a66f3a4799686a6921526a33b0797965" +dependencies = [ + "anstyle", + "difflib", + "itertools", + "predicates-core", +] + [[package]] name = "predicates-core" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" [[package]] name = "predicates-tree" @@ -7461,7 +7498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", ] [[package]] @@ -7496,7 +7533,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -7513,9 +7550,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -7554,7 +7591,7 @@ checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7584,7 +7621,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn", + "syn 1.0.109", "tempfile", "which", ] @@ -7612,7 +7649,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7679,9 +7716,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -7844,6 +7881,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -7851,7 +7897,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom 0.2.8", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] @@ -7872,7 +7918,7 @@ checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7889,9 +7935,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -7909,9 +7955,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "region" @@ -8094,7 +8140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ "bitflags", - "errno", + "errno 0.2.8", "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", @@ -8108,13 +8154,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ "bitflags", - "errno", + "errno 0.2.8", "io-lifetimes 1.0.5", "libc", "linux-raw-sys 0.1.4", "windows-sys 0.45.0", ] +[[package]] +name = "rustix" +version = "0.37.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aae838e49b3d63e9274e1c01833cc8139d3fec468c3b84688c628f44b1ae11d" +dependencies = [ + "bitflags", + "errno 0.3.0", + "io-lifetimes 1.0.5", + "libc", + "linux-raw-sys 0.3.1", + "windows-sys 0.45.0", +] + [[package]] name = "rustls" version = "0.19.1" @@ -8328,7 +8388,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -9556,7 +9616,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -9645,7 +9705,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -9858,7 +9918,7 @@ checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -10051,9 +10111,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -10104,7 +10164,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -10413,7 +10473,7 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn", + "syn 1.0.109", ] [[package]] @@ -10430,7 +10490,7 @@ version = "5.0.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -10650,7 +10710,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -10874,7 +10934,7 @@ dependencies = [ "proc-macro2", "quote", "sp-version", - "syn", + "syn 1.0.109", ] [[package]] @@ -10988,7 +11048,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -11016,7 +11076,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.109", ] [[package]] @@ -11066,6 +11126,20 @@ dependencies = [ "platforms 2.0.0", ] +[[package]] +name = "substrate-cli-test-utils" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "futures", + "nix 0.26.2", + "node-primitives", + "regex", + "substrate-rpc-client", + "tempfile", + "tokio", +] + [[package]] name = "substrate-frame-cli" version = "4.0.0-dev" @@ -11286,7 +11360,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -11340,6 +11414,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -11348,7 +11433,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "unicode-xid", ] @@ -11387,15 +11472,15 @@ checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5" [[package]] name = "tempfile" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", - "rustix 0.36.8", - "windows-sys 0.42.0", + "redox_syscall 0.3.5", + "rustix 0.37.7", + "windows-sys 0.45.0", ] [[package]] @@ -11436,7 +11521,7 @@ checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -11567,14 +11652,13 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.25.0" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", @@ -11582,18 +11666,18 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] @@ -11718,7 +11802,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -11907,6 +11991,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" name = "try-runtime-cli" version = "0.10.0-dev" dependencies = [ + "assert_cmd", "async-trait", "clap 4.1.8", "frame-remote-externalities", @@ -11914,6 +11999,7 @@ dependencies = [ "hex", "log", "parity-scale-codec", + "regex", "sc-cli", "sc-executor", "sc-service", @@ -11935,6 +12021,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-version", "sp-weights", + "substrate-cli-test-utils", "substrate-rpc-client", "tokio", "zstd", @@ -12216,7 +12303,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -12250,7 +12337,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -13192,7 +13279,7 @@ checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml index 4451935c36035..77e49ff07d6b5 100644 --- a/bin/node/cli/Cargo.toml +++ b/bin/node/cli/Cargo.toml @@ -127,6 +127,7 @@ tokio-util = { version = "0.7.4", features = ["compat"] } wait-timeout = "0.2" substrate-rpc-client = { path = "../../../utils/frame/rpc/client" } pallet-timestamp = { version = "4.0.0-dev", path = "../../../frame/timestamp" } +substrate-cli-test-utils = { path = "../../../test-utils/cli" } [build-dependencies] clap = { version = "4.0.9", optional = true } diff --git a/bin/node/cli/tests/benchmark_block_works.rs b/bin/node/cli/tests/benchmark_block_works.rs index 369e1b3e52d87..50103a66a4d40 100644 --- a/bin/node/cli/tests/benchmark_block_works.rs +++ b/bin/node/cli/tests/benchmark_block_works.rs @@ -23,7 +23,7 @@ use assert_cmd::cargo::cargo_bin; use std::process::Command; use tempfile::tempdir; -pub mod common; +use substrate_cli_test_utils as common; /// `benchmark block` works for the dev runtime using the wasm executor. #[tokio::test] diff --git a/bin/node/cli/tests/benchmark_pallet_works.rs b/bin/node/cli/tests/benchmark_pallet_works.rs index 053516b9521d1..2d9946543eed2 100644 --- a/bin/node/cli/tests/benchmark_pallet_works.rs +++ b/bin/node/cli/tests/benchmark_pallet_works.rs @@ -21,8 +21,6 @@ use assert_cmd::cargo::cargo_bin; use std::process::Command; -pub mod common; - /// `benchmark pallet` works for the different combinations of `steps` and `repeat`. #[test] fn benchmark_pallet_works() { diff --git a/bin/node/cli/tests/check_block_works.rs b/bin/node/cli/tests/check_block_works.rs index 019d97aa8228e..67bc5e6031ea0 100644 --- a/bin/node/cli/tests/check_block_works.rs +++ b/bin/node/cli/tests/check_block_works.rs @@ -22,7 +22,7 @@ use assert_cmd::cargo::cargo_bin; use std::process::Command; use tempfile::tempdir; -pub mod common; +use substrate_cli_test_utils as common; #[tokio::test] async fn check_block_works() { diff --git a/bin/node/cli/tests/common.rs b/bin/node/cli/tests/common.rs deleted file mode 100644 index 4c4824391fdc1..0000000000000 --- a/bin/node/cli/tests/common.rs +++ /dev/null @@ -1,168 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -#![cfg(unix)] - -use assert_cmd::cargo::cargo_bin; -use nix::{ - sys::signal::{kill, Signal, Signal::SIGINT}, - unistd::Pid, -}; -use node_primitives::{Hash, Header}; -use regex::Regex; -use std::{ - io::{BufRead, BufReader, Read}, - ops::{Deref, DerefMut}, - path::{Path, PathBuf}, - process::{self, Child, Command}, - time::Duration, -}; - -/// Run the given `future` and panic if the `timeout` is hit. -pub async fn run_with_timeout(timeout: Duration, future: impl futures::Future) { - tokio::time::timeout(timeout, future).await.expect("Hit timeout"); -} - -/// Wait for at least n blocks to be finalized from a specified node -pub async fn wait_n_finalized_blocks(n: usize, url: &str) { - use substrate_rpc_client::{ws_client, ChainApi}; - - let mut built_blocks = std::collections::HashSet::new(); - let mut interval = tokio::time::interval(Duration::from_secs(2)); - let rpc = ws_client(url).await.unwrap(); - - loop { - if let Ok(block) = ChainApi::<(), Hash, Header, ()>::finalized_head(&rpc).await { - built_blocks.insert(block); - if built_blocks.len() > n { - break - } - }; - interval.tick().await; - } -} - -/// Run the node for a while (3 blocks) -pub async fn run_node_for_a_while(base_path: &Path, args: &[&str]) { - run_with_timeout(Duration::from_secs(60 * 10), async move { - let mut cmd = Command::new(cargo_bin("substrate")) - .stdout(process::Stdio::piped()) - .stderr(process::Stdio::piped()) - .args(args) - .arg("-d") - .arg(base_path) - .spawn() - .unwrap(); - - let stderr = cmd.stderr.take().unwrap(); - - let mut child = KillChildOnDrop(cmd); - - let ws_url = extract_info_from_output(stderr).0.ws_url; - - // Let it produce some blocks. - wait_n_finalized_blocks(3, &ws_url).await; - - child.assert_still_running(); - - // Stop the process - child.stop(); - }) - .await -} - -pub struct KillChildOnDrop(pub Child); - -impl KillChildOnDrop { - /// Stop the child and wait until it is finished. - /// - /// Asserts if the exit status isn't success. - pub fn stop(&mut self) { - self.stop_with_signal(SIGINT); - } - - /// Same as [`Self::stop`] but takes the `signal` that is sent to stop the child. - pub fn stop_with_signal(&mut self, signal: Signal) { - kill(Pid::from_raw(self.id().try_into().unwrap()), signal).unwrap(); - assert!(self.wait().unwrap().success()); - } - - /// Asserts that the child is still running. - pub fn assert_still_running(&mut self) { - assert!(self.try_wait().unwrap().is_none(), "the process should still be running"); - } -} - -impl Drop for KillChildOnDrop { - fn drop(&mut self) { - let _ = self.0.kill(); - } -} - -impl Deref for KillChildOnDrop { - type Target = Child; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for KillChildOnDrop { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -/// Information extracted from a running node. -pub struct NodeInfo { - pub ws_url: String, - pub db_path: PathBuf, -} - -/// Extract [`NodeInfo`] from a running node by parsing its output. -/// -/// Returns the [`NodeInfo`] and all the read data. -pub fn extract_info_from_output(read: impl Read + Send) -> (NodeInfo, String) { - let mut data = String::new(); - - let ws_url = BufReader::new(read) - .lines() - .find_map(|line| { - let line = line.expect("failed to obtain next line while extracting node info"); - data.push_str(&line); - data.push_str("\n"); - - // does the line contain our port (we expect this specific output from substrate). - let sock_addr = match line.split_once("Running JSON-RPC WS server: addr=") { - None => return None, - Some((_, after)) => after.split_once(",").unwrap().0, - }; - - Some(format!("ws://{}", sock_addr)) - }) - .unwrap_or_else(|| { - eprintln!("Observed node output:\n{}", data); - panic!("We should get a WebSocket address") - }); - - // Database path is printed before the ws url! - let re = Regex::new(r"Database: .+ at (\S+)").unwrap(); - let db_path = PathBuf::from(re.captures(data.as_str()).unwrap().get(1).unwrap().as_str()); - - (NodeInfo { ws_url, db_path }, data) -} diff --git a/bin/node/cli/tests/export_import_flow.rs b/bin/node/cli/tests/export_import_flow.rs index afee9ef70c15a..b5785f99ea81f 100644 --- a/bin/node/cli/tests/export_import_flow.rs +++ b/bin/node/cli/tests/export_import_flow.rs @@ -23,7 +23,7 @@ use regex::Regex; use std::{fs, path::PathBuf, process::Command}; use tempfile::{tempdir, TempDir}; -pub mod common; +use substrate_cli_test_utils as common; fn contains_error(logged_output: &str) -> bool { logged_output.contains("Error") diff --git a/bin/node/cli/tests/inspect_works.rs b/bin/node/cli/tests/inspect_works.rs index 56569248befc0..3695c318a8df2 100644 --- a/bin/node/cli/tests/inspect_works.rs +++ b/bin/node/cli/tests/inspect_works.rs @@ -22,7 +22,7 @@ use assert_cmd::cargo::cargo_bin; use std::process::Command; use tempfile::tempdir; -pub mod common; +use substrate_cli_test_utils as common; #[tokio::test] async fn inspect_works() { diff --git a/bin/node/cli/tests/purge_chain_works.rs b/bin/node/cli/tests/purge_chain_works.rs index 470c0a7e48fba..77421f865a0d9 100644 --- a/bin/node/cli/tests/purge_chain_works.rs +++ b/bin/node/cli/tests/purge_chain_works.rs @@ -20,7 +20,7 @@ use assert_cmd::cargo::cargo_bin; use std::process::Command; use tempfile::tempdir; -pub mod common; +use substrate_cli_test_utils as common; #[tokio::test] #[cfg(unix)] diff --git a/bin/node/cli/tests/remember_state_pruning_works.rs b/bin/node/cli/tests/remember_state_pruning_works.rs index b8c5ddf4a4864..e28b2ef55ef6c 100644 --- a/bin/node/cli/tests/remember_state_pruning_works.rs +++ b/bin/node/cli/tests/remember_state_pruning_works.rs @@ -18,7 +18,7 @@ use tempfile::tempdir; -pub mod common; +use substrate_cli_test_utils as common; #[tokio::test] #[cfg(unix)] diff --git a/bin/node/cli/tests/running_the_node_and_interrupt.rs b/bin/node/cli/tests/running_the_node_and_interrupt.rs index 3d5598f3fbe23..29603f8fc560b 100644 --- a/bin/node/cli/tests/running_the_node_and_interrupt.rs +++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs @@ -25,7 +25,7 @@ use std::{ }; use tempfile::tempdir; -pub mod common; +use substrate_cli_test_utils as common; #[tokio::test] async fn running_the_node_works_and_can_be_interrupted() { diff --git a/bin/node/cli/tests/telemetry.rs b/bin/node/cli/tests/telemetry.rs index a68746a2c0011..f6e46775a22fb 100644 --- a/bin/node/cli/tests/telemetry.rs +++ b/bin/node/cli/tests/telemetry.rs @@ -21,7 +21,7 @@ use std::{process, time::Duration}; use crate::common::KillChildOnDrop; -pub mod common; +use substrate_cli_test_utils as common; pub mod websocket_server; #[tokio::test] diff --git a/bin/node/cli/tests/temp_base_path_works.rs b/bin/node/cli/tests/temp_base_path_works.rs index bfc9f88220030..fdcd9e23dde5a 100644 --- a/bin/node/cli/tests/temp_base_path_works.rs +++ b/bin/node/cli/tests/temp_base_path_works.rs @@ -24,7 +24,7 @@ use std::{ time::Duration, }; -pub mod common; +use substrate_cli_test_utils as common; #[allow(dead_code)] // Apparently `#[ignore]` doesn't actually work to disable this one. diff --git a/test-utils/cli/Cargo.toml b/test-utils/cli/Cargo.toml new file mode 100644 index 0000000000000..cc05884a6ebcd --- /dev/null +++ b/test-utils/cli/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "substrate-cli-test-utils" +description = "CLI testing utilities" +version = "0.1.0" +authors = ["Parity Technologies "] +edition = "2021" +license = "Apache-2.0" +homepage = "https://substrate.io" +repository = "https://github.com/paritytech/substrate/" +publish = false + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +substrate-rpc-client = { path = "../../utils/frame/rpc/client" } +assert_cmd = "2.0.10" +nix = "0.26.2" +regex = "1.7.3" +tempfile = "3.5.0" +tokio = { version = "1.22.0", features = ["full"] } +node-primitives = { path = "../../bin/node/primitives" } +futures = "0.3.28" diff --git a/utils/frame/try-runtime/cli/tests/common.rs b/test-utils/cli/src/lib.rs similarity index 72% rename from utils/frame/try-runtime/cli/tests/common.rs rename to test-utils/cli/src/lib.rs index e5df00d098949..476bcb8861ef1 100644 --- a/utils/frame/try-runtime/cli/tests/common.rs +++ b/test-utils/cli/src/lib.rs @@ -1,4 +1,3 @@ - // This file is part of Substrate. // Copyright (C) Parity Technologies (UK) Ltd. @@ -33,6 +32,59 @@ use std::{ process::{self, Child, Command}, time::Duration, }; +use tokio::io::{AsyncBufReadExt, AsyncRead}; + +/// Asynchronously reads lines from an async tokio stream and waits for +/// a pattern match. +/// +/// This function takes a readable tokio stream (e.g. from a child process `ChildStderr` or +/// `ChildStdout`) and a `Regex` pattern. It reads lines from the provided stream and checks +/// each line against the given pattern. The function returns as soon as a line matching the +/// pattern is found. +/// +/// # Arguments +/// +/// * `child_stream` - An async tokio stream, e.g. from a child process `ChildStderr` or +/// `ChildStdout`. +/// * `re` - A `Regex` pattern to search for in the stream. +/// +/// # Returns +/// +/// * `Ok(())` if a line matching the pattern is found. +/// * `Err(String)` if the stream ends without any lines matching the pattern, or if an error occurs +/// while reading the stream. +/// +/// # Example +/// +/// ``` +/// use regex::Regex; +/// use tokio::process::Command; +/// use tokio::io::AsyncRead; +/// +/// # async fn run() { +/// let child = Command::new("some-command").stderr(std::process::Stdio::piped()).spawn().unwrap(); +/// let stderr = child.stderr.unwrap(); +/// let re = Regex::new("error:").unwrap(); +/// +/// match wait_for_pattern_match_in_stream(stderr, re).await { +/// Ok(()) => println!("Error found in stderr"), +/// Err(e) => println!("Error: {}", e), +/// } +/// # } +/// ``` +pub async fn wait_for_stream_pattern_match(stream: R, re: Regex) -> Result<(), String> +where + R: AsyncRead + Unpin, +{ + let mut stdio_reader = tokio::io::BufReader::new(stream).lines(); + while let Ok(Some(line)) = stdio_reader.next_line().await { + match re.find(line.as_str()) { + Some(_) => return Ok(()), + None => (), + } + } + Err(String::from("Stderr stream ended without any lines matching the regex.")) +} /// Run the given `future` and panic if the `timeout` is hit. pub async fn run_with_timeout(timeout: Duration, future: impl futures::Future) { diff --git a/utils/frame/try-runtime/cli/Cargo.toml b/utils/frame/try-runtime/cli/Cargo.toml index b0de155940a48..a4d24986eddff 100644 --- a/utils/frame/try-runtime/cli/Cargo.toml +++ b/utils/frame/try-runtime/cli/Cargo.toml @@ -46,12 +46,9 @@ zstd = { version = "0.11.2", default-features = false } [dev-dependencies] assert_cmd = "2.0.10" -nix = "0.26.2" regex = "1.7.3" -tempfile = "3.5.0" -tokio = { version = "1.22.0", features = ["full"] } -node-primitives = { path = "../../../../bin/node/primitives" } -futures = "0.3.28" +substrate-cli-test-utils = { path = "../../../../test-utils/cli" } +tokio = "1.27.0" [features] try-runtime = ["sp-debug-derive/force-debug", "frame-try-runtime/try-runtime"] diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index 2babdf200f0d1..e661880417aac 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -24,65 +24,11 @@ use std::{ process::{self, Child, Command}, time::Duration, }; -use tokio::io::{AsyncBufReadExt, AsyncRead}; - -pub mod common; +use substrate_cli_test_utils as common; #[tokio::test] async fn follow_chain_works() { common::run_with_timeout(Duration::from_secs(60), async move { - /// Asynchronously reads lines from an async tokio stream and waits for - /// a pattern match. - /// - /// This function takes a readable tokio stream (e.g. from a child process `ChildStderr` or - /// `ChildStdout`) and a `Regex` pattern. It reads lines from the provided stream and checks - /// each line against the given pattern. The function returns as soon as a line matching the - /// pattern is found. - /// - /// # Arguments - /// - /// * `child_stream` - An async tokio stream, e.g. from a child process `ChildStderr` or - /// `ChildStdout`. - /// * `re` - A `Regex` pattern to search for in the stream. - /// - /// # Returns - /// - /// * `Ok(())` if a line matching the pattern is found. - /// * `Err(String)` if the stream ends without any lines matching the pattern, or if an - /// error occurs while reading the stream. - /// - /// # Example - /// - /// ``` - /// use regex::Regex; - /// use tokio::process::Command; - /// use tokio::io::AsyncRead; - /// - /// # async fn run() { - /// let child = Command::new("some-command").stderr(std::process::Stdio::piped()).spawn().unwrap(); - /// let stderr = child.stderr.unwrap(); - /// let re = Regex::new("error:").unwrap(); - /// - /// match wait_for_pattern_match_in_stream(stderr, re).await { - /// Ok(()) => println!("Error found in stderr"), - /// Err(e) => println!("Error: {}", e), - /// } - /// # } - /// ``` - async fn wait_for_stream_pattern_match(stream: R, re: Regex) -> Result<(), String> - where - R: AsyncRead + Unpin, - { - let mut stdio_reader = tokio::io::BufReader::new(stream).lines(); - while let Ok(Some(line)) = stdio_reader.next_line().await { - match re.find(line.as_str()) { - Some(_) => return Ok(()), - None => (), - } - } - Err(String::from("Stderr stream ended without any lines matching the regex.")) - } - fn start_node() -> Child { Command::new(cargo_bin("substrate")) .stdout(process::Stdio::piped()) @@ -110,7 +56,8 @@ async fn follow_chain_works() { // Kick off the follow-chain process and wait for it to process at least 3 blocks. let mut follow = start_follow(&ws_url); let re = Regex::new(r#".*executed block ([3-9]|[1-9]\d+).*"#).unwrap(); - let matched = wait_for_stream_pattern_match(follow.stderr.take().unwrap(), re).await; + let matched = + common::wait_for_stream_pattern_match(follow.stderr.take().unwrap(), re).await; // Assert that the follow-chain process has followed at least 5 blocks. assert!(matches!(matched, Ok(_))); From b2ad59010409d09aa18951ee0e4e4f542a259007 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 4 Apr 2023 20:10:25 +0400 Subject: [PATCH 08/27] fix comment --- utils/frame/try-runtime/cli/tests/follow_chain.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index e661880417aac..bd871e0c5206d 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -59,7 +59,7 @@ async fn follow_chain_works() { let matched = common::wait_for_stream_pattern_match(follow.stderr.take().unwrap(), re).await; - // Assert that the follow-chain process has followed at least 5 blocks. + // Assert that the follow-chain process has followed at least 3 blocks. assert!(matches!(matched, Ok(_))); // Sanity check: node is still running From f644dfa2abe9058388cef4c61e068aac2e48329d Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 4 Apr 2023 20:39:43 +0400 Subject: [PATCH 09/27] revert Cargo.lock changes --- Cargo.lock | 315 +++++++++++++++++++---------------------------------- 1 file changed, 114 insertions(+), 201 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 84a99fa888415..7fd0122f3cc0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -203,12 +203,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "anstyle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" - [[package]] name = "anyhow" version = "1.0.69" @@ -300,7 +294,7 @@ checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", "synstructure", ] @@ -312,7 +306,7 @@ checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", "synstructure", ] @@ -324,7 +318,7 @@ checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -335,14 +329,13 @@ checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" [[package]] name = "assert_cmd" -version = "2.0.10" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0b2340f55d9661d76793b2bfc2eb0e62689bd79d067a95707ea762afd5e9dd" +checksum = "9834fcc22e0874394a010230586367d4a3e9f11b560f469262678547e1d2575e" dependencies = [ - "anstyle", "bstr", "doc-comment", - "predicates 3.0.2", + "predicates", "predicates-core", "predicates-tree", "wait-timeout", @@ -414,7 +407,7 @@ checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -425,7 +418,7 @@ checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -571,7 +564,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 1.0.109", + "syn", ] [[package]] @@ -1053,7 +1046,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1431,7 +1424,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1516,7 +1509,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 1.0.109", + "syn", ] [[package]] @@ -1533,7 +1526,7 @@ checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1557,7 +1550,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 1.0.109", + "syn", ] [[package]] @@ -1568,7 +1561,7 @@ checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" dependencies = [ "darling_core", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1594,7 +1587,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn 1.0.109", + "syn", ] [[package]] @@ -1654,7 +1647,7 @@ checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1675,7 +1668,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1685,7 +1678,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn 1.0.109", + "syn", ] [[package]] @@ -1696,7 +1689,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1789,7 +1782,7 @@ checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1840,7 +1833,7 @@ checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1966,7 +1959,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -1986,7 +1979,7 @@ checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -2032,17 +2025,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "errno" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.45.0", -] - [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -2078,7 +2060,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -2155,7 +2137,7 @@ checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "windows-sys 0.45.0", ] @@ -2351,7 +2333,7 @@ dependencies = [ "quote", "scale-info", "sp-arithmetic", - "syn 1.0.109", + "syn", "trybuild", ] @@ -2488,7 +2470,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -2499,7 +2481,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -2508,7 +2490,7 @@ version = "3.0.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -2652,9 +2634,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" dependencies = [ "futures-channel", "futures-core", @@ -2667,9 +2649,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" dependencies = [ "futures-core", "futures-sink", @@ -2677,15 +2659,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" dependencies = [ "futures-core", "futures-task", @@ -2695,9 +2677,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" [[package]] name = "futures-lite" @@ -2716,13 +2698,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn", ] [[package]] @@ -2738,15 +2720,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" [[package]] name = "futures-timer" @@ -2756,9 +2738,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" dependencies = [ "futures-channel", "futures-core", @@ -3308,7 +3290,7 @@ checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -3532,7 +3514,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -4157,7 +4139,7 @@ checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" dependencies = [ "heck", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -4392,12 +4374,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" -[[package]] -name = "linux-raw-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" - [[package]] name = "lite-json" version = "0.2.0" @@ -4685,7 +4661,7 @@ dependencies = [ "fragile", "lazy_static", "mockall_derive", - "predicates 2.1.5", + "predicates", "predicates-tree", ] @@ -4698,7 +4674,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -4788,7 +4764,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn", "synstructure", ] @@ -4836,7 +4812,7 @@ checksum = "d232c68884c0c99810a5a4d333ef7e47689cfd0edc85efc9e54e1e6bf5212766" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -5053,7 +5029,6 @@ dependencies = [ "sp-transaction-pool", "sp-transaction-storage-proof", "substrate-build-script-utils", - "substrate-cli-test-utils", "substrate-frame-cli", "substrate-rpc-client", "tempfile", @@ -5910,7 +5885,7 @@ version = "4.0.0-dev" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -6793,7 +6768,7 @@ dependencies = [ "proc-macro2", "quote", "sp-runtime", - "syn 1.0.109", + "syn", ] [[package]] @@ -7101,7 +7076,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -7152,7 +7127,7 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", "winapi", ] @@ -7165,7 +7140,7 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall", "smallvec", "windows-sys 0.45.0", ] @@ -7254,7 +7229,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -7295,7 +7270,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -7451,23 +7426,11 @@ dependencies = [ "regex", ] -[[package]] -name = "predicates" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c575290b64d24745b6c57a12a31465f0a66f3a4799686a6921526a33b0797965" -dependencies = [ - "anstyle", - "difflib", - "itertools", - "predicates-core", -] - [[package]] name = "predicates-core" -version = "1.0.6" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" +checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" [[package]] name = "predicates-tree" @@ -7498,7 +7461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn", ] [[package]] @@ -7533,7 +7496,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", + "syn", "version_check", ] @@ -7550,9 +7513,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" dependencies = [ "unicode-ident", ] @@ -7591,7 +7554,7 @@ checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -7621,7 +7584,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 1.0.109", + "syn", "tempfile", "which", ] @@ -7649,7 +7612,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -7716,9 +7679,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.26" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] @@ -7881,15 +7844,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags", -] - [[package]] name = "redox_users" version = "0.4.3" @@ -7897,7 +7851,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom 0.2.8", - "redox_syscall 0.2.16", + "redox_syscall", "thiserror", ] @@ -7918,7 +7872,7 @@ checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -7935,9 +7889,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", @@ -7955,9 +7909,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "region" @@ -8140,7 +8094,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ "bitflags", - "errno 0.2.8", + "errno", "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", @@ -8154,27 +8108,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ "bitflags", - "errno 0.2.8", + "errno", "io-lifetimes 1.0.5", "libc", "linux-raw-sys 0.1.4", "windows-sys 0.45.0", ] -[[package]] -name = "rustix" -version = "0.37.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aae838e49b3d63e9274e1c01833cc8139d3fec468c3b84688c628f44b1ae11d" -dependencies = [ - "bitflags", - "errno 0.3.0", - "io-lifetimes 1.0.5", - "libc", - "linux-raw-sys 0.3.1", - "windows-sys 0.45.0", -] - [[package]] name = "rustls" version = "0.19.1" @@ -8388,7 +8328,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -9616,7 +9556,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -9705,7 +9645,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -9918,7 +9858,7 @@ checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -10111,9 +10051,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -10164,7 +10104,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -10473,7 +10413,7 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn 1.0.109", + "syn", ] [[package]] @@ -10490,7 +10430,7 @@ version = "5.0.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -10710,7 +10650,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -10934,7 +10874,7 @@ dependencies = [ "proc-macro2", "quote", "sp-version", - "syn 1.0.109", + "syn", ] [[package]] @@ -11048,7 +10988,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -11076,7 +11016,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn", ] [[package]] @@ -11126,20 +11066,6 @@ dependencies = [ "platforms 2.0.0", ] -[[package]] -name = "substrate-cli-test-utils" -version = "0.1.0" -dependencies = [ - "assert_cmd", - "futures", - "nix 0.26.2", - "node-primitives", - "regex", - "substrate-rpc-client", - "tempfile", - "tokio", -] - [[package]] name = "substrate-frame-cli" version = "4.0.0-dev" @@ -11360,7 +11286,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -11414,17 +11340,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn" -version = "2.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "synstructure" version = "0.12.6" @@ -11433,7 +11348,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", "unicode-xid", ] @@ -11472,15 +11387,15 @@ checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5" [[package]] name = "tempfile" -version = "3.5.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", - "rustix 0.37.7", - "windows-sys 0.45.0", + "redox_syscall", + "rustix 0.36.8", + "windows-sys 0.42.0", ] [[package]] @@ -11521,7 +11436,7 @@ checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -11652,13 +11567,14 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" dependencies = [ "autocfg", "bytes", "libc", + "memchr", "mio", "num_cpus", "parking_lot 0.12.1", @@ -11666,18 +11582,18 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.42.0", ] [[package]] name = "tokio-macros" -version = "2.0.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn", ] [[package]] @@ -11802,7 +11718,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -11991,7 +11907,6 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" name = "try-runtime-cli" version = "0.10.0-dev" dependencies = [ - "assert_cmd", "async-trait", "clap 4.1.8", "frame-remote-externalities", @@ -11999,7 +11914,6 @@ dependencies = [ "hex", "log", "parity-scale-codec", - "regex", "sc-cli", "sc-executor", "sc-service", @@ -12021,7 +11935,6 @@ dependencies = [ "sp-transaction-storage-proof", "sp-version", "sp-weights", - "substrate-cli-test-utils", "substrate-rpc-client", "tokio", "zstd", @@ -12303,7 +12216,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn", "wasm-bindgen-shared", ] @@ -12337,7 +12250,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -13279,7 +13192,7 @@ checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", "synstructure", ] From b9a6eba99a4753755d045e7427d275bf9420ba3f Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 4 Apr 2023 20:43:08 +0400 Subject: [PATCH 10/27] update Cargo.lock --- Cargo.lock | 315 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 201 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7fd0122f3cc0f..84a99fa888415 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -203,6 +203,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstyle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" + [[package]] name = "anyhow" version = "1.0.69" @@ -294,7 +300,7 @@ checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -306,7 +312,7 @@ checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -318,7 +324,7 @@ checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -329,13 +335,14 @@ checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" [[package]] name = "assert_cmd" -version = "2.0.8" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9834fcc22e0874394a010230586367d4a3e9f11b560f469262678547e1d2575e" +checksum = "ec0b2340f55d9661d76793b2bfc2eb0e62689bd79d067a95707ea762afd5e9dd" dependencies = [ + "anstyle", "bstr", "doc-comment", - "predicates", + "predicates 3.0.2", "predicates-core", "predicates-tree", "wait-timeout", @@ -407,7 +414,7 @@ checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -418,7 +425,7 @@ checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -564,7 +571,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn", + "syn 1.0.109", ] [[package]] @@ -1046,7 +1053,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1424,7 +1431,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1509,7 +1516,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn", + "syn 1.0.109", ] [[package]] @@ -1526,7 +1533,7 @@ checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1550,7 +1557,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.109", ] [[package]] @@ -1561,7 +1568,7 @@ checksum = "b36230598a2d5de7ec1c6f51f72d8a99a9208daff41de2084d06e3fd3ea56685" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1587,7 +1594,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" dependencies = [ "data-encoding", - "syn", + "syn 1.0.109", ] [[package]] @@ -1647,7 +1654,7 @@ checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1668,7 +1675,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1678,7 +1685,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" dependencies = [ "derive_builder_core", - "syn", + "syn 1.0.109", ] [[package]] @@ -1689,7 +1696,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1782,7 +1789,7 @@ checksum = "3bf95dc3f046b9da4f2d51833c0d3547d8564ef6910f5c1ed130306a75b92886" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1833,7 +1840,7 @@ checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1959,7 +1966,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1979,7 +1986,7 @@ checksum = "f58dc3c5e468259f19f2d46304a6b28f1c3d034442e14b322d2b850e36f6d5ae" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2025,6 +2032,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -2060,7 +2078,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2137,7 +2155,7 @@ checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "windows-sys 0.45.0", ] @@ -2333,7 +2351,7 @@ dependencies = [ "quote", "scale-info", "sp-arithmetic", - "syn", + "syn 1.0.109", "trybuild", ] @@ -2470,7 +2488,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2481,7 +2499,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2490,7 +2508,7 @@ version = "3.0.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2634,9 +2652,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -2649,9 +2667,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -2659,15 +2677,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -2677,9 +2695,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" @@ -2698,13 +2716,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] @@ -2720,15 +2738,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-timer" @@ -2738,9 +2756,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -3290,7 +3308,7 @@ checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3514,7 +3532,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4139,7 +4157,7 @@ checksum = "9d527d5827582abd44a6d80c07ff8b50b4ee238a8979e05998474179e79dc400" dependencies = [ "heck", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4374,6 +4392,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +[[package]] +name = "linux-raw-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" + [[package]] name = "lite-json" version = "0.2.0" @@ -4661,7 +4685,7 @@ dependencies = [ "fragile", "lazy_static", "mockall_derive", - "predicates", + "predicates 2.1.5", "predicates-tree", ] @@ -4674,7 +4698,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -4764,7 +4788,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] @@ -4812,7 +4836,7 @@ checksum = "d232c68884c0c99810a5a4d333ef7e47689cfd0edc85efc9e54e1e6bf5212766" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -5029,6 +5053,7 @@ dependencies = [ "sp-transaction-pool", "sp-transaction-storage-proof", "substrate-build-script-utils", + "substrate-cli-test-utils", "substrate-frame-cli", "substrate-rpc-client", "tempfile", @@ -5885,7 +5910,7 @@ version = "4.0.0-dev" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -6768,7 +6793,7 @@ dependencies = [ "proc-macro2", "quote", "sp-runtime", - "syn", + "syn 1.0.109", ] [[package]] @@ -7076,7 +7101,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7127,7 +7152,7 @@ dependencies = [ "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "winapi", ] @@ -7140,7 +7165,7 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "windows-sys 0.45.0", ] @@ -7229,7 +7254,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7270,7 +7295,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7426,11 +7451,23 @@ dependencies = [ "regex", ] +[[package]] +name = "predicates" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c575290b64d24745b6c57a12a31465f0a66f3a4799686a6921526a33b0797965" +dependencies = [ + "anstyle", + "difflib", + "itertools", + "predicates-core", +] + [[package]] name = "predicates-core" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" +checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" [[package]] name = "predicates-tree" @@ -7461,7 +7498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", ] [[package]] @@ -7496,7 +7533,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -7513,9 +7550,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -7554,7 +7591,7 @@ checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7584,7 +7621,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn", + "syn 1.0.109", "tempfile", "which", ] @@ -7612,7 +7649,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7679,9 +7716,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -7844,6 +7881,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -7851,7 +7897,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom 0.2.8", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] @@ -7872,7 +7918,7 @@ checksum = "9f9c0c92af03644e4806106281fe2e068ac5bc0ae74a707266d06ea27bccee5f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -7889,9 +7935,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -7909,9 +7955,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "region" @@ -8094,7 +8140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ "bitflags", - "errno", + "errno 0.2.8", "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", @@ -8108,13 +8154,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ "bitflags", - "errno", + "errno 0.2.8", "io-lifetimes 1.0.5", "libc", "linux-raw-sys 0.1.4", "windows-sys 0.45.0", ] +[[package]] +name = "rustix" +version = "0.37.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aae838e49b3d63e9274e1c01833cc8139d3fec468c3b84688c628f44b1ae11d" +dependencies = [ + "bitflags", + "errno 0.3.0", + "io-lifetimes 1.0.5", + "libc", + "linux-raw-sys 0.3.1", + "windows-sys 0.45.0", +] + [[package]] name = "rustls" version = "0.19.1" @@ -8328,7 +8388,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -9556,7 +9616,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -9645,7 +9705,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -9858,7 +9918,7 @@ checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -10051,9 +10111,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -10104,7 +10164,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -10413,7 +10473,7 @@ dependencies = [ "proc-macro2", "quote", "sp-core-hashing", - "syn", + "syn 1.0.109", ] [[package]] @@ -10430,7 +10490,7 @@ version = "5.0.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -10650,7 +10710,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -10874,7 +10934,7 @@ dependencies = [ "proc-macro2", "quote", "sp-version", - "syn", + "syn 1.0.109", ] [[package]] @@ -10988,7 +11048,7 @@ dependencies = [ "memchr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -11016,7 +11076,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.109", ] [[package]] @@ -11066,6 +11126,20 @@ dependencies = [ "platforms 2.0.0", ] +[[package]] +name = "substrate-cli-test-utils" +version = "0.1.0" +dependencies = [ + "assert_cmd", + "futures", + "nix 0.26.2", + "node-primitives", + "regex", + "substrate-rpc-client", + "tempfile", + "tokio", +] + [[package]] name = "substrate-frame-cli" version = "4.0.0-dev" @@ -11286,7 +11360,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -11340,6 +11414,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -11348,7 +11433,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "unicode-xid", ] @@ -11387,15 +11472,15 @@ checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5" [[package]] name = "tempfile" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", - "rustix 0.36.8", - "windows-sys 0.42.0", + "redox_syscall 0.3.5", + "rustix 0.37.7", + "windows-sys 0.45.0", ] [[package]] @@ -11436,7 +11521,7 @@ checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -11567,14 +11652,13 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.25.0" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", @@ -11582,18 +11666,18 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] @@ -11718,7 +11802,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -11907,6 +11991,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" name = "try-runtime-cli" version = "0.10.0-dev" dependencies = [ + "assert_cmd", "async-trait", "clap 4.1.8", "frame-remote-externalities", @@ -11914,6 +11999,7 @@ dependencies = [ "hex", "log", "parity-scale-codec", + "regex", "sc-cli", "sc-executor", "sc-service", @@ -11935,6 +12021,7 @@ dependencies = [ "sp-transaction-storage-proof", "sp-version", "sp-weights", + "substrate-cli-test-utils", "substrate-rpc-client", "tokio", "zstd", @@ -12216,7 +12303,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -12250,7 +12337,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -13192,7 +13279,7 @@ checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] From 90f135e177129d9a4805c35e0f958a6a59fe75bd Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 4 Apr 2023 21:20:02 +0400 Subject: [PATCH 11/27] improve doc comment --- test-utils/cli/src/lib.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test-utils/cli/src/lib.rs b/test-utils/cli/src/lib.rs index 476bcb8861ef1..bd275421fe6fe 100644 --- a/test-utils/cli/src/lib.rs +++ b/test-utils/cli/src/lib.rs @@ -34,13 +34,10 @@ use std::{ }; use tokio::io::{AsyncBufReadExt, AsyncRead}; -/// Asynchronously reads lines from an async tokio stream and waits for -/// a pattern match. -/// -/// This function takes a readable tokio stream (e.g. from a child process `ChildStderr` or -/// `ChildStdout`) and a `Regex` pattern. It reads lines from the provided stream and checks -/// each line against the given pattern. The function returns as soon as a line matching the -/// pattern is found. +/// Takes a readable tokio stream (e.g. from a child process `ChildStderr` or `ChildStdout`) and +/// a `Regex` pattern, and checks each line against the given pattern as it is produced. +/// The function returns OK(()) as soon as a line matching the pattern is found, or an Err if +/// the stream ends without any lines matching the pattern. /// /// # Arguments /// @@ -51,8 +48,7 @@ use tokio::io::{AsyncBufReadExt, AsyncRead}; /// # Returns /// /// * `Ok(())` if a line matching the pattern is found. -/// * `Err(String)` if the stream ends without any lines matching the pattern, or if an error occurs -/// while reading the stream. +/// * `Err(String)` if the stream ends without any lines matching the pattern. /// /// # Example /// From 00aa83b87efe712cbf3a69db6de849f57628d0c6 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 4 Apr 2023 21:27:07 +0400 Subject: [PATCH 12/27] fix error typo --- test-utils/cli/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-utils/cli/src/lib.rs b/test-utils/cli/src/lib.rs index bd275421fe6fe..53074682cb209 100644 --- a/test-utils/cli/src/lib.rs +++ b/test-utils/cli/src/lib.rs @@ -79,7 +79,7 @@ where None => (), } } - Err(String::from("Stderr stream ended without any lines matching the regex.")) + Err(String::from("Stream closed without any lines matching the regex.")) } /// Run the given `future` and panic if the `timeout` is hit. From 0f79142a2596e5d1475ae6588d63a9ef6e8f1811 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Tue, 4 Apr 2023 22:01:26 +0400 Subject: [PATCH 13/27] update Cargo.lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index c4c6236932a08..d4185103f8c96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7557,7 +7557,7 @@ checksum = "9d4f284d87b9cedc2ff57223cbc4e3937cd6063c01e92c8e2a8c080df0013933" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] From 44b456b422ef7b9248cece220cf70e0f25fb996c Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 10:47:21 +0400 Subject: [PATCH 14/27] feature gate try-runtime test --- frame/support/src/traits/hooks.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/frame/support/src/traits/hooks.rs b/frame/support/src/traits/hooks.rs index b4a4e835efab0..70a2fae390bc4 100644 --- a/frame/support/src/traits/hooks.rs +++ b/frame/support/src/traits/hooks.rs @@ -361,6 +361,7 @@ mod tests { use super::*; use sp_io::TestExternalities; + #[cfg(feature = "try-runtime")] #[test] fn on_runtime_upgrade_pre_post_executed_tuple() { crate::parameter_types! { From 38dee61374e08115956d7979c139030c59f00d62 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 14:09:24 +0400 Subject: [PATCH 15/27] build_substrate cli test util --- test-utils/cli/src/lib.rs | 51 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/test-utils/cli/src/lib.rs b/test-utils/cli/src/lib.rs index 53074682cb209..8a358f6ebf792 100644 --- a/test-utils/cli/src/lib.rs +++ b/test-utils/cli/src/lib.rs @@ -26,6 +26,7 @@ use nix::{ use node_primitives::{Hash, Header}; use regex::Regex; use std::{ + env, io::{BufRead, BufReader, Read}, ops::{Deref, DerefMut}, path::{Path, PathBuf}, @@ -34,6 +35,56 @@ use std::{ }; use tokio::io::{AsyncBufReadExt, AsyncRead}; +/// Builds the Substrate project using the provided arguments. +/// +/// This function reads the CARGO_MANIFEST_DIR environment variable to find the root workspace +/// directory. It then runs the `cargo b` command in the root directory with the specified +/// arguments. +/// +/// This can be useful for building the Substrate binary with a desired set of features prior +/// to using the binary in a CLI test. +/// +/// # Arguments +/// +/// * `args: &[&str]` - A slice of string references representing the arguments to pass to the +/// `cargo b` command. +/// +/// # Panics +/// +/// This function will panic if: +/// +/// * The CARGO_MANIFEST_DIR environment variable is not set. +/// * The root workspace directory cannot be determined. +/// * The 'cargo b' command fails to execute. +/// * The 'cargo b' command returns a non-successful status. +/// +/// # Examples +/// +/// ```rust +/// build_substrate(&["--features=try-runtime"]); +/// ``` +pub fn build_substrate(args: &[&str]) { + // Get the root workspace directory from the CARGO_MANIFEST_DIR environment variable + let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set"); + let root_dir = std::path::Path::new(&manifest_dir) + .parent() + .expect("Failed to find root workspace directory"); + let output = Command::new("cargo") + .arg("b") + .args(args) + .current_dir(root_dir) + .output() + .expect(format!("Failed to execute 'cargo b' with args {:?}'", args).as_str()); + + if !output.status.success() { + panic!( + "Failed to execute 'cargo b' with args {:?}': \n{}", + args, + String::from_utf8_lossy(&output.stderr) + ); + } +} + /// Takes a readable tokio stream (e.g. from a child process `ChildStderr` or `ChildStdout`) and /// a `Regex` pattern, and checks each line against the given pattern as it is produced. /// The function returns OK(()) as soon as a line matching the pattern is found, or an Err if From 5532ee6a5a591cde9392a7efcb9ec99c9ec32c21 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 14:09:39 +0400 Subject: [PATCH 16/27] feature gate follow_chain tests --- .../try-runtime/cli/tests/follow_chain.rs | 90 ++++++++++--------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index bd871e0c5206d..5cb4e28e0b49e 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -18,52 +18,58 @@ #![cfg(unix)] -use assert_cmd::cargo::cargo_bin; -use regex::Regex; -use std::{ - process::{self, Child, Command}, - time::Duration, -}; -use substrate_cli_test_utils as common; +#[cfg(feature = "try-runtime")] +mod follow_chain_tests { + use assert_cmd::cargo::cargo_bin; + use regex::Regex; + use std::{ + process::{self, Child, Command}, + time::Duration, + }; + use substrate_cli_test_utils as common; -#[tokio::test] -async fn follow_chain_works() { - common::run_with_timeout(Duration::from_secs(60), async move { - fn start_node() -> Child { - Command::new(cargo_bin("substrate")) - .stdout(process::Stdio::piped()) - .stderr(process::Stdio::piped()) - .args(&["--dev", "--tmp", "--ws-port=45789", "--no-hardware-benchmarks"]) - .spawn() - .unwrap() - } + #[tokio::test] + async fn follow_chain_works() { + common::run_with_timeout(Duration::from_secs(60), async move { + fn start_node() -> Child { + Command::new(cargo_bin("substrate")) + .stdout(process::Stdio::piped()) + .stderr(process::Stdio::piped()) + .args(&["--dev", "--tmp", "--ws-port=45789", "--no-hardware-benchmarks"]) + .spawn() + .unwrap() + } - fn start_follow(ws_url: &str) -> tokio::process::Child { - tokio::process::Command::new(cargo_bin("substrate")) - .stdout(process::Stdio::piped()) - .stderr(process::Stdio::piped()) - .args(&["try-runtime", "--runtime=existing"]) - .args(&["follow-chain", format!("--uri={}", ws_url).as_str()]) - .spawn() - .unwrap() - } + fn start_follow(ws_url: &str) -> tokio::process::Child { + tokio::process::Command::new(cargo_bin("substrate")) + .stdout(process::Stdio::piped()) + .stderr(process::Stdio::piped()) + .args(&["try-runtime", "--runtime=existing"]) + .args(&["follow-chain", format!("--uri={}", ws_url).as_str()]) + .spawn() + .unwrap() + } - // Start a node and wait for it to begin finalizing blocks - let mut node = start_node(); - let ws_url = common::extract_info_from_output(node.stderr.take().unwrap()).0.ws_url; - common::wait_n_finalized_blocks(1, &ws_url).await; + // Build substrate so the tests use the current version of the code + common::build_substrate(&["--features=try-runtime"]); - // Kick off the follow-chain process and wait for it to process at least 3 blocks. - let mut follow = start_follow(&ws_url); - let re = Regex::new(r#".*executed block ([3-9]|[1-9]\d+).*"#).unwrap(); - let matched = - common::wait_for_stream_pattern_match(follow.stderr.take().unwrap(), re).await; + // Start a node and wait for it to begin finalizing blocks + let mut node = start_node(); + let ws_url = common::extract_info_from_output(node.stderr.take().unwrap()).0.ws_url; + common::wait_n_finalized_blocks(1, &ws_url).await; - // Assert that the follow-chain process has followed at least 3 blocks. - assert!(matches!(matched, Ok(_))); + // Kick off the follow-chain process and wait for it to process at least 3 blocks. + let mut follow = start_follow(&ws_url); + let re = Regex::new(r#".*executed block ([3-9]|[1-9]\d+).*"#).unwrap(); + let matched = + common::wait_for_stream_pattern_match(follow.stderr.take().unwrap(), re).await; - // Sanity check: node is still running - assert!(node.try_wait().unwrap().is_none()); - }) - .await; + // Assert that the follow-chain process has followed at least 3 blocks. + assert!(matches!(matched, Ok(_))); + + // Sanity check: node is still running + assert!(node.try_wait().unwrap().is_none()); + }) + .await; + } } From 3ca75d366fa5a0321210b8fc46d02b662740c7db Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 14:49:49 +0400 Subject: [PATCH 17/27] move fn start_node to test-utils --- .../tests/running_the_node_and_interrupt.rs | 13 ++----- test-utils/cli/src/lib.rs | 36 ++++++++++++++++++- .../try-runtime/cli/tests/follow_chain.rs | 11 +----- 3 files changed, 38 insertions(+), 22 deletions(-) diff --git a/bin/node/cli/tests/running_the_node_and_interrupt.rs b/bin/node/cli/tests/running_the_node_and_interrupt.rs index 29603f8fc560b..f2b473273f8cf 100644 --- a/bin/node/cli/tests/running_the_node_and_interrupt.rs +++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs @@ -71,17 +71,8 @@ async fn running_the_node_works_and_can_be_interrupted() { #[tokio::test] async fn running_two_nodes_with_the_same_ws_port_should_work() { common::run_with_timeout(Duration::from_secs(60 * 10), async move { - fn start_node() -> Child { - Command::new(cargo_bin("substrate")) - .stdout(process::Stdio::piped()) - .stderr(process::Stdio::piped()) - .args(&["--dev", "--tmp", "--ws-port=45789", "--no-hardware-benchmarks"]) - .spawn() - .unwrap() - } - - let mut first_node = common::KillChildOnDrop(start_node()); - let mut second_node = common::KillChildOnDrop(start_node()); + let mut first_node = common::KillChildOnDrop(common::start_node()); + let mut second_node = common::KillChildOnDrop(common::start_node()); let stderr = first_node.stderr.take().unwrap(); let ws_url = common::extract_info_from_output(stderr).0.ws_url; diff --git a/test-utils/cli/src/lib.rs b/test-utils/cli/src/lib.rs index 8a358f6ebf792..a1560473230c0 100644 --- a/test-utils/cli/src/lib.rs +++ b/test-utils/cli/src/lib.rs @@ -35,6 +35,40 @@ use std::{ }; use tokio::io::{AsyncBufReadExt, AsyncRead}; +/// Starts a new Substrate node in development mode with a temporary chain. +/// +/// This function creates a new Substrate node using the `substrate` binary. +/// It configures the node to run in development mode (`--dev`) with a temporary chain (`--tmp`), +/// sets the WebSocket port to 45789 (`--ws-port=45789`). +/// +/// # Returns +/// +/// A [`Child`] process representing the spawned Substrate node. +/// +/// # Panics +/// +/// This function will panic if the `substrate` binary is not found or if the node fails to start. +/// +/// # Examples +/// +/// ``` +/// use my_crate::start_node; +/// +/// let child = start_node(); +/// // Interact with the Substrate node using the WebSocket port 45789. +/// // When done, the node will be killed when the `child` is dropped. +/// ``` +/// +/// [`Child`]: std::process::Child +pub fn start_node() -> Child { + Command::new(cargo_bin("substrate")) + .stdout(process::Stdio::piped()) + .stderr(process::Stdio::piped()) + .args(&["--dev", "--tmp", "--ws-port=45789", "--no-hardware-benchmarks"]) + .spawn() + .unwrap() +} + /// Builds the Substrate project using the provided arguments. /// /// This function reads the CARGO_MANIFEST_DIR environment variable to find the root workspace @@ -101,7 +135,7 @@ pub fn build_substrate(args: &[&str]) { /// * `Ok(())` if a line matching the pattern is found. /// * `Err(String)` if the stream ends without any lines matching the pattern. /// -/// # Example +/// # Examples /// /// ``` /// use regex::Regex; diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index 5cb4e28e0b49e..ff2efc094e631 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -31,15 +31,6 @@ mod follow_chain_tests { #[tokio::test] async fn follow_chain_works() { common::run_with_timeout(Duration::from_secs(60), async move { - fn start_node() -> Child { - Command::new(cargo_bin("substrate")) - .stdout(process::Stdio::piped()) - .stderr(process::Stdio::piped()) - .args(&["--dev", "--tmp", "--ws-port=45789", "--no-hardware-benchmarks"]) - .spawn() - .unwrap() - } - fn start_follow(ws_url: &str) -> tokio::process::Child { tokio::process::Command::new(cargo_bin("substrate")) .stdout(process::Stdio::piped()) @@ -54,7 +45,7 @@ mod follow_chain_tests { common::build_substrate(&["--features=try-runtime"]); // Start a node and wait for it to begin finalizing blocks - let mut node = start_node(); + let mut node = common::start_node(); let ws_url = common::extract_info_from_output(node.stderr.take().unwrap()).0.ws_url; common::wait_n_finalized_blocks(1, &ws_url).await; From 2a6d8121b12fbb93c18689e927f4623439be2531 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 14:51:49 +0400 Subject: [PATCH 18/27] improve test pkg name --- utils/frame/try-runtime/cli/tests/follow_chain.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index ff2efc094e631..3ca4ad5f82c66 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -19,7 +19,7 @@ #![cfg(unix)] #[cfg(feature = "try-runtime")] -mod follow_chain_tests { +mod tests { use assert_cmd::cargo::cargo_bin; use regex::Regex; use std::{ From 7b3ca6f81bb80d01a592e75e81596b82e2d66125 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 14:55:43 +0400 Subject: [PATCH 19/27] use tokio Child and Command --- utils/frame/try-runtime/cli/tests/follow_chain.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index 3ca4ad5f82c66..2aaa7ea5b5e1c 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -23,16 +23,17 @@ mod tests { use assert_cmd::cargo::cargo_bin; use regex::Regex; use std::{ - process::{self, Child, Command}, + process::{self}, time::Duration, }; use substrate_cli_test_utils as common; + use tokio::process::{Child, Command}; #[tokio::test] async fn follow_chain_works() { common::run_with_timeout(Duration::from_secs(60), async move { - fn start_follow(ws_url: &str) -> tokio::process::Child { - tokio::process::Command::new(cargo_bin("substrate")) + fn start_follow(ws_url: &str) -> Child { + Command::new(cargo_bin("substrate")) .stdout(process::Stdio::piped()) .stderr(process::Stdio::piped()) .args(&["try-runtime", "--runtime=existing"]) From 391b74140992a9d4415d62434809649f7daca6f4 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 16:00:55 +0400 Subject: [PATCH 20/27] remove redundant import --- bin/node/cli/tests/running_the_node_and_interrupt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/node/cli/tests/running_the_node_and_interrupt.rs b/bin/node/cli/tests/running_the_node_and_interrupt.rs index f2b473273f8cf..1308067da0256 100644 --- a/bin/node/cli/tests/running_the_node_and_interrupt.rs +++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs @@ -20,7 +20,7 @@ use assert_cmd::cargo::cargo_bin; use nix::sys::signal::Signal::{self, SIGINT, SIGTERM}; use std::{ - process::{self, Child, Command}, + process::{self, Command}, time::Duration, }; use tempfile::tempdir; From 99e23ae31254e408fea8eccd7cdc2b58c7279858 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 16:41:31 +0400 Subject: [PATCH 21/27] fix ci --- test-utils/cli/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-utils/cli/src/lib.rs b/test-utils/cli/src/lib.rs index a1560473230c0..8f8f4cf477f6c 100644 --- a/test-utils/cli/src/lib.rs +++ b/test-utils/cli/src/lib.rs @@ -94,7 +94,7 @@ pub fn start_node() -> Child { /// /// # Examples /// -/// ```rust +/// ```ignore /// build_substrate(&["--features=try-runtime"]); /// ``` pub fn build_substrate(args: &[&str]) { @@ -137,7 +137,7 @@ pub fn build_substrate(args: &[&str]) { /// /// # Examples /// -/// ``` +/// ```ignore /// use regex::Regex; /// use tokio::process::Command; /// use tokio::io::AsyncRead; From 28dab863242f04d306ab65305da4ec2f64ba08ed Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 16:45:32 +0400 Subject: [PATCH 22/27] fix ci --- test-utils/cli/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-utils/cli/src/lib.rs b/test-utils/cli/src/lib.rs index 8f8f4cf477f6c..3cc747aded160 100644 --- a/test-utils/cli/src/lib.rs +++ b/test-utils/cli/src/lib.rs @@ -51,7 +51,7 @@ use tokio::io::{AsyncBufReadExt, AsyncRead}; /// /// # Examples /// -/// ``` +/// ```ignore /// use my_crate::start_node; /// /// let child = start_node(); From ffeb78144a0b385d28d29f119e716ded1f6472be Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 16:53:22 +0400 Subject: [PATCH 23/27] don't leave hanging processes --- utils/frame/try-runtime/cli/tests/follow_chain.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index 2aaa7ea5b5e1c..05468839ab0f3 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -31,6 +31,9 @@ mod tests { #[tokio::test] async fn follow_chain_works() { + // Build substrate so binaries used in the test use the latest code. + common::build_substrate(&["--features=try-runtime"]); + common::run_with_timeout(Duration::from_secs(60), async move { fn start_follow(ws_url: &str) -> Child { Command::new(cargo_bin("substrate")) @@ -42,9 +45,6 @@ mod tests { .unwrap() } - // Build substrate so the tests use the current version of the code - common::build_substrate(&["--features=try-runtime"]); - // Start a node and wait for it to begin finalizing blocks let mut node = common::start_node(); let ws_url = common::extract_info_from_output(node.stderr.take().unwrap()).0.ws_url; @@ -59,8 +59,9 @@ mod tests { // Assert that the follow-chain process has followed at least 3 blocks. assert!(matches!(matched, Ok(_))); - // Sanity check: node is still running - assert!(node.try_wait().unwrap().is_none()); + // Don't leave hanging processes + node.kill().unwrap(); + follow.kill().await.unwrap(); }) .await; } From 99c62a7e344659b3ef184fbd66bd5e85d3ad2ee8 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 17:20:41 +0400 Subject: [PATCH 24/27] improved child process cleanup --- test-utils/cli/src/lib.rs | 22 +++++++++++++++++++ .../try-runtime/cli/tests/follow_chain.rs | 11 +++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/test-utils/cli/src/lib.rs b/test-utils/cli/src/lib.rs index 3cc747aded160..2b15a789996d5 100644 --- a/test-utils/cli/src/lib.rs +++ b/test-utils/cli/src/lib.rs @@ -35,6 +35,28 @@ use std::{ }; use tokio::io::{AsyncBufReadExt, AsyncRead}; +/// Ensure the child is killed if it leaves its given scope. +/// +/// # Usage +/// ```ignore +/// fn main() { +/// let child = Command::new("/bin/cat").spawn().unwrap(); +/// let _guard = ChildGuard(child); +/// panic!("Main thread panicking"); +/// } +/// ``` +pub struct ChildGuard(pub Child); + +impl Drop for ChildGuard { + fn drop(&mut self) { + // You can check std::thread::panicking() here + match self.0.kill() { + Err(e) => println!("Could not kill child process: {}", e), + Ok(_) => println!("Successfully killed child process"), + } + } +} + /// Starts a new Substrate node in development mode with a temporary chain. /// /// This function creates a new Substrate node using the `substrate` binary. diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index 05468839ab0f3..5b62c060a417a 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -41,13 +41,16 @@ mod tests { .stderr(process::Stdio::piped()) .args(&["try-runtime", "--runtime=existing"]) .args(&["follow-chain", format!("--uri={}", ws_url).as_str()]) + .kill_on_drop(true) .spawn() .unwrap() } // Start a node and wait for it to begin finalizing blocks - let mut node = common::start_node(); - let ws_url = common::extract_info_from_output(node.stderr.take().unwrap()).0.ws_url; + // Wrap the node in a ChildGuard so that it is killed when it is dropped. + let node = common::start_node(); + let mut node = common::ChildGuard(node); + let ws_url = common::extract_info_from_output(node.0.stderr.take().unwrap()).0.ws_url; common::wait_n_finalized_blocks(1, &ws_url).await; // Kick off the follow-chain process and wait for it to process at least 3 blocks. @@ -58,10 +61,6 @@ mod tests { // Assert that the follow-chain process has followed at least 3 blocks. assert!(matches!(matched, Ok(_))); - - // Don't leave hanging processes - node.kill().unwrap(); - follow.kill().await.unwrap(); }) .await; } From 8c351c2b97e8d6097707ea1921eb23d505fc0357 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 17:29:21 +0400 Subject: [PATCH 25/27] use existing KillChildOnDrop --- test-utils/cli/src/lib.rs | 22 ------------------- .../try-runtime/cli/tests/follow_chain.rs | 5 ++--- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/test-utils/cli/src/lib.rs b/test-utils/cli/src/lib.rs index 2b15a789996d5..3cc747aded160 100644 --- a/test-utils/cli/src/lib.rs +++ b/test-utils/cli/src/lib.rs @@ -35,28 +35,6 @@ use std::{ }; use tokio::io::{AsyncBufReadExt, AsyncRead}; -/// Ensure the child is killed if it leaves its given scope. -/// -/// # Usage -/// ```ignore -/// fn main() { -/// let child = Command::new("/bin/cat").spawn().unwrap(); -/// let _guard = ChildGuard(child); -/// panic!("Main thread panicking"); -/// } -/// ``` -pub struct ChildGuard(pub Child); - -impl Drop for ChildGuard { - fn drop(&mut self) { - // You can check std::thread::panicking() here - match self.0.kill() { - Err(e) => println!("Could not kill child process: {}", e), - Ok(_) => println!("Successfully killed child process"), - } - } -} - /// Starts a new Substrate node in development mode with a temporary chain. /// /// This function creates a new Substrate node using the `substrate` binary. diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index 5b62c060a417a..5820a348cad25 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -48,9 +48,8 @@ mod tests { // Start a node and wait for it to begin finalizing blocks // Wrap the node in a ChildGuard so that it is killed when it is dropped. - let node = common::start_node(); - let mut node = common::ChildGuard(node); - let ws_url = common::extract_info_from_output(node.0.stderr.take().unwrap()).0.ws_url; + let mut node = common::KillChildOnDrop(common::start_node()); + let ws_url = common::extract_info_from_output(node.stderr.take().unwrap()).0.ws_url; common::wait_n_finalized_blocks(1, &ws_url).await; // Kick off the follow-chain process and wait for it to process at least 3 blocks. From 10a7b9ef161d1a0a2660427dee91718bae605331 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Wed, 5 Apr 2023 17:31:31 +0400 Subject: [PATCH 26/27] remove redundant comment --- utils/frame/try-runtime/cli/tests/follow_chain.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/frame/try-runtime/cli/tests/follow_chain.rs b/utils/frame/try-runtime/cli/tests/follow_chain.rs index 5820a348cad25..a4961aa280171 100644 --- a/utils/frame/try-runtime/cli/tests/follow_chain.rs +++ b/utils/frame/try-runtime/cli/tests/follow_chain.rs @@ -47,7 +47,6 @@ mod tests { } // Start a node and wait for it to begin finalizing blocks - // Wrap the node in a ChildGuard so that it is killed when it is dropped. let mut node = common::KillChildOnDrop(common::start_node()); let ws_url = common::extract_info_from_output(node.stderr.take().unwrap()).0.ws_url; common::wait_n_finalized_blocks(1, &ws_url).await; From a01da35a43f8c15520686ecd17d1103820cde2f3 Mon Sep 17 00:00:00 2001 From: Liam Aharon Date: Thu, 6 Apr 2023 19:04:25 +1000 Subject: [PATCH 27/27] Update test-utils/cli/src/lib.rs Co-authored-by: Koute --- test-utils/cli/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-utils/cli/src/lib.rs b/test-utils/cli/src/lib.rs index 3cc747aded160..1846f19090b33 100644 --- a/test-utils/cli/src/lib.rs +++ b/test-utils/cli/src/lib.rs @@ -104,7 +104,7 @@ pub fn build_substrate(args: &[&str]) { .parent() .expect("Failed to find root workspace directory"); let output = Command::new("cargo") - .arg("b") + .arg("build") .args(args) .current_dir(root_dir) .output()