Skip to content

Commit

Permalink
re-export subxt and signer (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola authored Dec 8, 2024
1 parent 20629ea commit 56e26a8
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 10 deletions.
6 changes: 3 additions & 3 deletions crates/configuration/src/shared/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion crates/examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
2 changes: 1 addition & 1 deletion crates/examples/examples/add_para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
6 changes: 6 additions & 0 deletions crates/examples/examples/para_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::env;

use anyhow::anyhow;
use zombienet_sdk::{
subxt,
tx_helper::{ChainUpgrade, RuntimeUpgradeOptions},
NetworkConfigBuilder,
};
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/examples/examples/pjs.rs
Original file line number Diff line number Diff line change
@@ -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<dyn std::error::Error>> {
Expand Down
2 changes: 1 addition & 1 deletion crates/examples/examples/simple_network_example.rs
Original file line number Diff line number Diff line change
@@ -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<dyn std::error::Error>> {
Expand Down
2 changes: 1 addition & 1 deletion crates/orchestrator/src/generators/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion crates/orchestrator/src/network/chain_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion crates/sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 4 additions & 0 deletions crates/sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 56e26a8

Please sign in to comment.