diff --git a/Cargo.toml b/Cargo.toml index 4de74d161399745a0ee0ca8e45fc1f924d3e0008..765e898feee50e50aa418eed0459ee3632ca1a87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ members = [ [workspace.package] authors = ["Parity Technologies <admin@parity.io>"] edition = "2021" -version = "0.1.0-alpha.0" +version = "0.1.0-alpha.1" rust-version = "1.70.0" license = "Apache-2.0 OR GPL-3.0" repository = "https://github.com/paritytech/zombienet-sdk" @@ -44,8 +44,8 @@ sha2 = { version = "0.10.2", default-features = false } hex = "0.4" sp-core = "22.0.0" libp2p = { version = "0.52" } -subxt = "0.32.0" -subxt-signer = { version = "0.32.0", features = ["subxt"] } +subxt = "0.33.0" +subxt-signer = { version = "0.33.0", features = ["subxt"] } tracing = "0.1.35" pjs-rs = "0.1.2" axum = { version = "0.7" } @@ -55,9 +55,9 @@ tower-http = { version = "0.5" } tracing-subscriber = { version = "0.3" } # Zombienet workspace crates: -support = { package = "zombienet-support", version = "0.1.0-alpha.0", path = "crates/support" } -configuration = { package = "zombienet-configuration", version = "0.1.0-alpha.0", path = "crates/configuration" } -orchestrator = { package = "zombienet-orchestrator", version = "0.1.0-alpha.0", path = "crates/orchestrator" } -provider = { package = "zombienet-provider", version = "0.1.0-alpha.0", path = "crates/provider" } -prom-metrics-parser = { package = "zombienet-prom-metrics-parser", version = "0.1.0-alpha.0", path = "crates/prom-metrics-parser" } -sdk = { package = "zombienet-sdk", version = "0.1.0-alpha.0", path = "crates/sdk" } +support = { package = "zombienet-support", version = "0.1.0-alpha.1", path = "crates/support" } +configuration = { package = "zombienet-configuration", version = "0.1.0-alpha.1", path = "crates/configuration" } +orchestrator = { package = "zombienet-orchestrator", version = "0.1.0-alpha.1", path = "crates/orchestrator" } +provider = { package = "zombienet-provider", version = "0.1.0-alpha.1", path = "crates/provider" } +prom-metrics-parser = { package = "zombienet-prom-metrics-parser", version = "0.1.0-alpha.1", path = "crates/prom-metrics-parser" } +zombienet-sdk = { version = "0.1.0-alpha.1", path = "crates/sdk" } diff --git a/crates/examples/Cargo.toml b/crates/examples/Cargo.toml index f067060a678a6e14a59055238bec5c7e45cf44ce..40fcf727ade5a4379101de875ccb9cf8630bb255 100644 --- a/crates/examples/Cargo.toml +++ b/crates/examples/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -zombienet-sdk = { path = "../sdk" } +zombienet-sdk = {workspace = true } tokio = { workspace = true } futures = { workspace = true } subxt = { workspace = true } diff --git a/crates/orchestrator/src/network/parachain.rs b/crates/orchestrator/src/network/parachain.rs index 9e43039eadfc7047780b37e99a627a7503e7fc34..5c7db8292fcd02081ae20d6c83fd7fc5890fa6d2 100644 --- a/crates/orchestrator/src/network/parachain.rs +++ b/crates/orchestrator/src/network/parachain.rs @@ -4,7 +4,7 @@ use std::{ }; use provider::types::TransferedFile; -use subxt::{dynamic::Value, OnlineClient, SubstrateConfig}; +use subxt::{dynamic::Value, tx::TxStatus, OnlineClient, SubstrateConfig}; use subxt_signer::{sr25519::Keypair, SecretUri}; use support::fs::FileSystem; use tracing::info; @@ -138,13 +138,28 @@ impl Parachain { // TODO: uncomment below and fix the sign and submit (and follow afterwards until // finalized block) to register the parachain - let result = api + let mut tx = api .tx() .sign_and_submit_then_watch_default(&sudo_call, &sudo) .await?; - let result = result.wait_for_in_block().await?; - info!("In block: {:#?}", result.block_hash()); + // Below we use the low level API to replicate the `wait_for_in_block` behaviour + // which was removed in subxt 0.33.0. See https://github.com/paritytech/subxt/pull/1237. + while let Some(status) = tx.next().await { + match status? { + TxStatus::InBestBlock(tx_in_block) | TxStatus::InFinalizedBlock(tx_in_block) => { + let result = tx_in_block.wait_for_success().await?; + info!("In block: {:#?}", result.block_hash()); + }, + TxStatus::Error { message } + | TxStatus::Invalid { message } + | TxStatus::Dropped { message } => { + return Err(anyhow::format_err!("Error submitting tx: {message}")); + }, + _ => continue, + } + } + Ok(()) } }