Skip to content

Commit

Permalink
Bump subxt (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou authored Jan 24, 2024
1 parent 31c5de4 commit 2b948fb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 14 deletions.
18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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" }
Expand All @@ -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" }
2 changes: 1 addition & 1 deletion crates/examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
23 changes: 19 additions & 4 deletions crates/orchestrator/src/network/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(())
}
}
Expand Down

0 comments on commit 2b948fb

Please sign in to comment.