diff --git a/crates/configuration/src/shared/types.rs b/crates/configuration/src/shared/types.rs index 1defc2123..06903fa83 100644 --- a/crates/configuration/src/shared/types.rs +++ b/crates/configuration/src/shared/types.rs @@ -55,7 +55,7 @@ impl Serialize for U128 { struct U128Visitor; -impl<'de> de::Visitor<'de> for U128Visitor { +impl de::Visitor<'_> for U128Visitor { type Value = U128; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -308,7 +308,7 @@ impl Serialize for AssetLocation { struct AssetLocationVisitor; -impl<'de> de::Visitor<'de> for AssetLocationVisitor { +impl de::Visitor<'_> for AssetLocationVisitor { type Value = AssetLocation; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { @@ -379,7 +379,7 @@ impl Serialize for Arg { struct ArgVisitor; -impl<'de> de::Visitor<'de> for ArgVisitor { +impl de::Visitor<'_> for ArgVisitor { type Value = Arg; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/crates/examples/Cargo.toml b/crates/examples/Cargo.toml index a11ef2746..d2809b78f 100644 --- a/crates/examples/Cargo.toml +++ b/crates/examples/Cargo.toml @@ -9,7 +9,6 @@ edition = "2021" zombienet-sdk = {workspace = true, features = ["pjs"]} tokio = { workspace = true } futures = { workspace = true } -subxt = { workspace = true } tracing-subscriber = "0.3" serde_json = { workspace = true } anyhow = { workspace = true } diff --git a/crates/examples/examples/add_para.rs b/crates/examples/examples/add_para.rs index 04b1b1739..cd0621050 100644 --- a/crates/examples/examples/add_para.rs +++ b/crates/examples/examples/add_para.rs @@ -2,7 +2,7 @@ use std::time::Duration; use anyhow::anyhow; use futures::stream::StreamExt; -use zombienet_sdk::{NetworkConfigBuilder, NetworkConfigExt}; +use zombienet_sdk::{subxt, NetworkConfigBuilder, NetworkConfigExt}; #[tokio::main] async fn main() -> Result<(), anyhow::Error> { diff --git a/crates/examples/examples/para_upgrade.rs b/crates/examples/examples/para_upgrade.rs index b6e41ff4f..a54820065 100644 --- a/crates/examples/examples/para_upgrade.rs +++ b/crates/examples/examples/para_upgrade.rs @@ -5,6 +5,7 @@ use std::env; use anyhow::anyhow; use zombienet_sdk::{ + subxt, tx_helper::{ChainUpgrade, RuntimeUpgradeOptions}, NetworkConfigBuilder, }; @@ -76,6 +77,11 @@ async fn main() -> Result<(), anyhow::Error> { panic!("You need to provide the PATH to the wasm file to use to upgrade, through first argument or 'ZOMBIE_WASM_INCREMENTED_PATH' env var"); }; + // wait 2 more blocks + alice + .wait_metric(BEST_BLOCK_METRIC, |x| x > best_block + 50_f64) + .await?; + println!("Perfoming upgrade from path {wasm}"); network diff --git a/crates/examples/examples/pjs.rs b/crates/examples/examples/pjs.rs index 8200e1529..12e295de2 100644 --- a/crates/examples/examples/pjs.rs +++ b/crates/examples/examples/pjs.rs @@ -1,6 +1,6 @@ use futures::stream::StreamExt; use serde_json::json; -use zombienet_sdk::{NetworkConfigBuilder, NetworkConfigExt}; +use zombienet_sdk::{subxt, NetworkConfigBuilder, NetworkConfigExt}; #[tokio::main] async fn main() -> Result<(), Box> { diff --git a/crates/examples/examples/simple_network_example.rs b/crates/examples/examples/simple_network_example.rs index d600209ab..e6a191b1c 100644 --- a/crates/examples/examples/simple_network_example.rs +++ b/crates/examples/examples/simple_network_example.rs @@ -1,5 +1,5 @@ use futures::stream::StreamExt; -use zombienet_sdk::{NetworkConfig, NetworkConfigExt}; +use zombienet_sdk::{subxt, NetworkConfig, NetworkConfigExt}; #[tokio::main] async fn main() -> Result<(), Box> { diff --git a/crates/orchestrator/src/generators/command.rs b/crates/orchestrator/src/generators/command.rs index 977c4e4de..c8043e204 100644 --- a/crates/orchestrator/src/generators/command.rs +++ b/crates/orchestrator/src/generators/command.rs @@ -13,7 +13,7 @@ pub struct GenCmdOptions<'a> { pub use_default_ports_in_cmd: bool, } -impl<'a> Default for GenCmdOptions<'a> { +impl Default for GenCmdOptions<'_> { fn default() -> Self { Self { relay_chain_name: "rococo-local", diff --git a/crates/orchestrator/src/network/chain_upgrade.rs b/crates/orchestrator/src/network/chain_upgrade.rs index 56f7bba31..3b9945ce2 100644 --- a/crates/orchestrator/src/network/chain_upgrade.rs +++ b/crates/orchestrator/src/network/chain_upgrade.rs @@ -13,7 +13,6 @@ pub trait ChainUpgrade { /// /// This call 'System.set_code_without_checks' wrapped in /// 'Sudo.sudo_unchecked_weight' - async fn runtime_upgrade(&self, options: RuntimeUpgradeOptions) -> Result<(), anyhow::Error>; /// Perform a runtime upgrade (with sudo), inner call with the node pass as arg. diff --git a/crates/sdk/Cargo.toml b/crates/sdk/Cargo.toml index 414a46188..dfae5c96c 100644 --- a/crates/sdk/Cargo.toml +++ b/crates/sdk/Cargo.toml @@ -16,8 +16,9 @@ keywords = ["zombienet", "sdk"] async-trait = { workspace = true } tokio = { workspace = true } futures = { workspace = true } -subxt = { workspace = true } lazy_static = { workspace = true } +subxt = { workspace = true, features = ["substrate-compat"] } +subxt-signer = { workspace = true, features = ["subxt"] } # Zombienet deps configuration = { workspace = true } diff --git a/crates/sdk/src/lib.rs b/crates/sdk/src/lib.rs index 790f8784e..7da21ed64 100644 --- a/crates/sdk/src/lib.rs +++ b/crates/sdk/src/lib.rs @@ -21,6 +21,10 @@ pub use support::fs::local::LocalFileSystem; pub mod environment; pub const PROVIDERS: [&str; 3] = ["k8s", "native", "docker"]; +// re-export subxt +pub use subxt; +pub use subxt_signer; + #[async_trait] pub trait NetworkConfigExt { /// Spawns a network using the native or k8s provider.