fix: migrate vendor rustfmt.toml to stable-only features
- Update vendor/pezkuwi-zombienet-sdk/rustfmt.toml to stable-only - Reformat 74 vendor files with stable rustfmt - Remove nightly-only features causing CI failures
This commit is contained in:
+24
-39
@@ -5,9 +5,9 @@ const BEST_BLOCK_METRIC: &str = "block_height{status=\"best\"}";
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn rococo_local_with_omni_node_and_wasm_runtime() {
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let config = NetworkConfigBuilder::new()
|
||||
let config = NetworkConfigBuilder::new()
|
||||
.with_relaychain(|relaychain| {
|
||||
relaychain
|
||||
.with_chain("rococo-local")
|
||||
@@ -29,47 +29,32 @@ async fn rococo_local_with_omni_node_and_wasm_runtime() {
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
let spawn_fn = get_spawn_fn();
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
let spawn_fn = get_spawn_fn();
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
|
||||
println!("🚀🚀🚀🚀 network deployed");
|
||||
println!("🚀🚀🚀🚀 network deployed");
|
||||
|
||||
// wait 2 blocks
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
assert!(alice
|
||||
.wait_metric(BEST_BLOCK_METRIC, |b| b > 2_f64)
|
||||
.await
|
||||
.is_ok());
|
||||
// wait 2 blocks
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
assert!(alice.wait_metric(BEST_BLOCK_METRIC, |b| b > 2_f64).await.is_ok());
|
||||
|
||||
// omni-collator-1
|
||||
let collator = network.get_node("omni-collator-1").unwrap();
|
||||
let client = collator
|
||||
.wait_client::<subxt::PolkadotConfig>()
|
||||
.await
|
||||
.unwrap();
|
||||
// omni-collator-1
|
||||
let collator = network.get_node("omni-collator-1").unwrap();
|
||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
||||
|
||||
// wait 1 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!(
|
||||
"Block (omni-collator-1) #{}",
|
||||
block.unwrap().header().number
|
||||
);
|
||||
}
|
||||
// wait 1 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!("Block (omni-collator-1) #{}", block.unwrap().header().number);
|
||||
}
|
||||
|
||||
// omni-collator-2
|
||||
let collator = network.get_node("omni-collator-2").unwrap();
|
||||
let client = collator
|
||||
.wait_client::<subxt::PolkadotConfig>()
|
||||
.await
|
||||
.unwrap();
|
||||
// omni-collator-2
|
||||
let collator = network.get_node("omni-collator-2").unwrap();
|
||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
||||
|
||||
// wait 1 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!(
|
||||
"Block (omni-collator-2) #{}",
|
||||
block.unwrap().header().number
|
||||
);
|
||||
}
|
||||
// wait 1 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!("Block (omni-collator-2) #{}", block.unwrap().header().number);
|
||||
}
|
||||
}
|
||||
|
||||
+24
-39
@@ -5,9 +5,9 @@ const BEST_BLOCK_METRIC: &str = "block_height{status=\"best\"}";
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn polkadot_local_with_chain_spec_runtime() {
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
let config = NetworkConfigBuilder::new()
|
||||
let config = NetworkConfigBuilder::new()
|
||||
.with_relaychain(|relaychain| {
|
||||
relaychain
|
||||
.with_chain("polkadot-local")
|
||||
@@ -30,47 +30,32 @@ async fn polkadot_local_with_chain_spec_runtime() {
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
let spawn_fn = get_spawn_fn();
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
let spawn_fn = get_spawn_fn();
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
|
||||
println!("🚀🚀🚀🚀 network deployed");
|
||||
println!("🚀🚀🚀🚀 network deployed");
|
||||
|
||||
// wait 2 blocks
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
assert!(alice
|
||||
.wait_metric(BEST_BLOCK_METRIC, |b| b > 2_f64)
|
||||
.await
|
||||
.is_ok());
|
||||
// wait 2 blocks
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
assert!(alice.wait_metric(BEST_BLOCK_METRIC, |b| b > 2_f64).await.is_ok());
|
||||
|
||||
// asset-hub-collator-1
|
||||
let collator = network.get_node("asset-hub-collator-1").unwrap();
|
||||
let client = collator
|
||||
.wait_client::<subxt::PolkadotConfig>()
|
||||
.await
|
||||
.unwrap();
|
||||
// asset-hub-collator-1
|
||||
let collator = network.get_node("asset-hub-collator-1").unwrap();
|
||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
||||
|
||||
// wait 1 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!(
|
||||
"Block (asset-hub-collator-1) #{}",
|
||||
block.unwrap().header().number
|
||||
);
|
||||
}
|
||||
// wait 1 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!("Block (asset-hub-collator-1) #{}", block.unwrap().header().number);
|
||||
}
|
||||
|
||||
// asset-hub-collator-2
|
||||
let collator = network.get_node("asset-hub-collator-2").unwrap();
|
||||
let client = collator
|
||||
.wait_client::<subxt::PolkadotConfig>()
|
||||
.await
|
||||
.unwrap();
|
||||
// asset-hub-collator-2
|
||||
let collator = network.get_node("asset-hub-collator-2").unwrap();
|
||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
||||
|
||||
// wait 1 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!(
|
||||
"Block (asset-hub-collator-2) #{}",
|
||||
block.unwrap().header().number
|
||||
);
|
||||
}
|
||||
// wait 1 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(1);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!("Block (asset-hub-collator-2) #{}", block.unwrap().header().number);
|
||||
}
|
||||
}
|
||||
|
||||
+16
-19
@@ -4,7 +4,7 @@ use configuration::{NetworkConfig, NetworkConfigBuilder};
|
||||
use zombienet_sdk::environment::get_spawn_fn;
|
||||
|
||||
fn small_network() -> NetworkConfig {
|
||||
NetworkConfigBuilder::new()
|
||||
NetworkConfigBuilder::new()
|
||||
.with_relaychain(|r| {
|
||||
r.with_chain("rococo-local")
|
||||
.with_default_command("polkadot")
|
||||
@@ -31,27 +31,24 @@ fn small_network() -> NetworkConfig {
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn ci_native_smoke_should_works() {
|
||||
tracing_subscriber::fmt::init();
|
||||
const BEST_BLOCK_METRIC: &str = "block_height{status=\"best\"}";
|
||||
let now = Instant::now();
|
||||
let config = small_network();
|
||||
let spawn_fn = get_spawn_fn();
|
||||
tracing_subscriber::fmt::init();
|
||||
const BEST_BLOCK_METRIC: &str = "block_height{status=\"best\"}";
|
||||
let now = Instant::now();
|
||||
let config = small_network();
|
||||
let spawn_fn = get_spawn_fn();
|
||||
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
|
||||
let elapsed = now.elapsed();
|
||||
println!("🚀🚀🚀🚀 network deployed in {elapsed:.2?}");
|
||||
let elapsed = now.elapsed();
|
||||
println!("🚀🚀🚀🚀 network deployed in {elapsed:.2?}");
|
||||
|
||||
network.wait_until_is_up(20).await.unwrap();
|
||||
network.wait_until_is_up(20).await.unwrap();
|
||||
|
||||
let elapsed = now.elapsed();
|
||||
println!("✅✅✅✅ network is up in {elapsed:.2?}");
|
||||
let elapsed = now.elapsed();
|
||||
println!("✅✅✅✅ network is up in {elapsed:.2?}");
|
||||
|
||||
// Get a ref to the node
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
// wait 10 blocks
|
||||
alice
|
||||
.wait_metric(BEST_BLOCK_METRIC, |x| x > 9_f64)
|
||||
.await
|
||||
.unwrap();
|
||||
// Get a ref to the node
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
// wait 10 blocks
|
||||
alice.wait_metric(BEST_BLOCK_METRIC, |x| x > 9_f64).await.unwrap();
|
||||
}
|
||||
|
||||
+109
-137
@@ -6,174 +6,146 @@ use orchestrator::{AddCollatorOptions, AddNodeOptions};
|
||||
use zombienet_sdk::environment::{get_attach_fn, get_spawn_fn};
|
||||
|
||||
fn small_network() -> NetworkConfig {
|
||||
NetworkConfigBuilder::new()
|
||||
.with_relaychain(|r| {
|
||||
r.with_chain("rococo-local")
|
||||
.with_default_command("polkadot")
|
||||
.with_default_image("docker.io/parity/polkadot:v1.20.2")
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
})
|
||||
.with_parachain(|p| {
|
||||
p.with_id(2000).cumulus_based(true).with_collator(|n| {
|
||||
n.with_name("collator")
|
||||
.with_command("polkadot-parachain")
|
||||
.with_image("docker.io/parity/polkadot-parachain:1.7.0")
|
||||
})
|
||||
})
|
||||
.with_parachain(|p| {
|
||||
p.with_id(3000).cumulus_based(true).with_collator(|n| {
|
||||
n.with_name("collator-new")
|
||||
.with_command("polkadot-parachain")
|
||||
.with_image("docker.io/parity/polkadot-parachain:v1.20.2")
|
||||
})
|
||||
})
|
||||
.with_global_settings(|g| {
|
||||
g.with_base_dir(PathBuf::from("/tmp/zombie-1"))
|
||||
.with_tear_down_on_failure(false)
|
||||
})
|
||||
.build()
|
||||
.unwrap()
|
||||
NetworkConfigBuilder::new()
|
||||
.with_relaychain(|r| {
|
||||
r.with_chain("rococo-local")
|
||||
.with_default_command("polkadot")
|
||||
.with_default_image("docker.io/parity/polkadot:v1.20.2")
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
})
|
||||
.with_parachain(|p| {
|
||||
p.with_id(2000).cumulus_based(true).with_collator(|n| {
|
||||
n.with_name("collator")
|
||||
.with_command("polkadot-parachain")
|
||||
.with_image("docker.io/parity/polkadot-parachain:1.7.0")
|
||||
})
|
||||
})
|
||||
.with_parachain(|p| {
|
||||
p.with_id(3000).cumulus_based(true).with_collator(|n| {
|
||||
n.with_name("collator-new")
|
||||
.with_command("polkadot-parachain")
|
||||
.with_image("docker.io/parity/polkadot-parachain:v1.20.2")
|
||||
})
|
||||
})
|
||||
.with_global_settings(|g| {
|
||||
g.with_base_dir(PathBuf::from("/tmp/zombie-1")).with_tear_down_on_failure(false)
|
||||
})
|
||||
.build()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn ci_k8s_basic_functionalities_should_works() {
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
let _ = tracing_subscriber::fmt::try_init();
|
||||
|
||||
const BEST_BLOCK_METRIC: &str = "block_height{status=\"best\"}";
|
||||
let now = Instant::now();
|
||||
const BEST_BLOCK_METRIC: &str = "block_height{status=\"best\"}";
|
||||
let now = Instant::now();
|
||||
|
||||
let config = small_network();
|
||||
let spawn_fn = get_spawn_fn();
|
||||
let config = small_network();
|
||||
let spawn_fn = get_spawn_fn();
|
||||
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
|
||||
let elapsed = now.elapsed();
|
||||
println!("🚀🚀🚀🚀 network deployed in {elapsed:.2?}");
|
||||
let elapsed = now.elapsed();
|
||||
println!("🚀🚀🚀🚀 network deployed in {elapsed:.2?}");
|
||||
|
||||
// detach and attach to running
|
||||
network.detach().await;
|
||||
drop(network);
|
||||
let attach_fn = get_attach_fn();
|
||||
let zombie_path = PathBuf::from("/tmp/zombie-1/zombie.json");
|
||||
let mut network = attach_fn(zombie_path).await.unwrap();
|
||||
// detach and attach to running
|
||||
network.detach().await;
|
||||
drop(network);
|
||||
let attach_fn = get_attach_fn();
|
||||
let zombie_path = PathBuf::from("/tmp/zombie-1/zombie.json");
|
||||
let mut network = attach_fn(zombie_path).await.unwrap();
|
||||
|
||||
// Get a ref to the node
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
// Get a ref to the node
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
|
||||
let (_best_block_pass, client) = try_join!(
|
||||
alice.wait_metric(BEST_BLOCK_METRIC, |x| x > 5_f64),
|
||||
alice.wait_client::<subxt::PolkadotConfig>()
|
||||
)
|
||||
.unwrap();
|
||||
let (_best_block_pass, client) = try_join!(
|
||||
alice.wait_metric(BEST_BLOCK_METRIC, |x| x > 5_f64),
|
||||
alice.wait_client::<subxt::PolkadotConfig>()
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
alice
|
||||
.wait_log_line_count("*rted #1*", true, 10)
|
||||
.await
|
||||
.unwrap();
|
||||
alice.wait_log_line_count("*rted #1*", true, 10).await.unwrap();
|
||||
|
||||
// check best block through metrics with timeout
|
||||
assert!(alice
|
||||
.wait_metric_with_timeout(BEST_BLOCK_METRIC, |x| x > 10_f64, 45_u32)
|
||||
.await
|
||||
.is_ok());
|
||||
// check best block through metrics with timeout
|
||||
assert!(alice
|
||||
.wait_metric_with_timeout(BEST_BLOCK_METRIC, |x| x > 10_f64, 45_u32)
|
||||
.await
|
||||
.is_ok());
|
||||
|
||||
// ensure timeout error
|
||||
let best_block = alice.reports(BEST_BLOCK_METRIC).await.unwrap();
|
||||
let res = alice
|
||||
.wait_metric_with_timeout(BEST_BLOCK_METRIC, |x| x > (best_block * 2_f64), 10_u32)
|
||||
.await;
|
||||
// ensure timeout error
|
||||
let best_block = alice.reports(BEST_BLOCK_METRIC).await.unwrap();
|
||||
let res = alice
|
||||
.wait_metric_with_timeout(BEST_BLOCK_METRIC, |x| x > (best_block * 2_f64), 10_u32)
|
||||
.await;
|
||||
|
||||
assert!(res.is_err());
|
||||
assert!(res.is_err());
|
||||
|
||||
// get single metric
|
||||
let role = alice.reports("node_roles").await.unwrap();
|
||||
println!("Role is {role}");
|
||||
assert_eq!(role, 4.0);
|
||||
// get single metric
|
||||
let role = alice.reports("node_roles").await.unwrap();
|
||||
println!("Role is {role}");
|
||||
assert_eq!(role, 4.0);
|
||||
|
||||
// subxt
|
||||
// wait 3 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(3);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!("Block #{}", block.unwrap().header().number);
|
||||
}
|
||||
// subxt
|
||||
// wait 3 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(3);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!("Block #{}", block.unwrap().header().number);
|
||||
}
|
||||
|
||||
// drop the client
|
||||
drop(client);
|
||||
// drop the client
|
||||
drop(client);
|
||||
|
||||
// check best block through metrics
|
||||
let best_block = alice
|
||||
.reports("block_height{status=\"best\"}")
|
||||
.await
|
||||
.unwrap();
|
||||
// check best block through metrics
|
||||
let best_block = alice.reports("block_height{status=\"best\"}").await.unwrap();
|
||||
|
||||
assert!(best_block >= 2.0, "Current best {best_block}");
|
||||
assert!(best_block >= 2.0, "Current best {best_block}");
|
||||
|
||||
// collator
|
||||
let collator = network.get_node("collator").unwrap();
|
||||
let client = collator
|
||||
.wait_client::<subxt::PolkadotConfig>()
|
||||
.await
|
||||
.unwrap();
|
||||
// collator
|
||||
let collator = network.get_node("collator").unwrap();
|
||||
let client = collator.wait_client::<subxt::PolkadotConfig>().await.unwrap();
|
||||
|
||||
// wait 3 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(3);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!("Block (para) #{}", block.unwrap().header().number);
|
||||
}
|
||||
// wait 3 blocks
|
||||
let mut blocks = client.blocks().subscribe_finalized().await.unwrap().take(3);
|
||||
while let Some(block) = blocks.next().await {
|
||||
println!("Block (para) #{}", block.unwrap().header().number);
|
||||
}
|
||||
|
||||
// add node
|
||||
let opts = AddNodeOptions {
|
||||
rpc_port: Some(9444),
|
||||
is_validator: true,
|
||||
..Default::default()
|
||||
};
|
||||
// add node
|
||||
let opts = AddNodeOptions { rpc_port: Some(9444), is_validator: true, ..Default::default() };
|
||||
|
||||
network.add_node("new1", opts).await.unwrap();
|
||||
network.add_node("new1", opts).await.unwrap();
|
||||
|
||||
// add collator
|
||||
let col_opts = AddCollatorOptions {
|
||||
command: Some("polkadot-parachain".try_into().unwrap()),
|
||||
image: Some(
|
||||
"docker.io/parity/polkadot-parachain:1.7.0"
|
||||
.try_into()
|
||||
.unwrap(),
|
||||
),
|
||||
..Default::default()
|
||||
};
|
||||
// add collator
|
||||
let col_opts = AddCollatorOptions {
|
||||
command: Some("polkadot-parachain".try_into().unwrap()),
|
||||
image: Some("docker.io/parity/polkadot-parachain:1.7.0".try_into().unwrap()),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
network
|
||||
.add_collator("new-col-1", col_opts, 2000)
|
||||
.await
|
||||
.unwrap();
|
||||
network.add_collator("new-col-1", col_opts, 2000).await.unwrap();
|
||||
|
||||
// pause / resume
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
alice.pause().await.unwrap();
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
|
||||
// pause / resume
|
||||
let alice = network.get_node("alice").unwrap();
|
||||
alice.pause().await.unwrap();
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
|
||||
|
||||
let res_err = alice
|
||||
.wait_metric_with_timeout(BEST_BLOCK_METRIC, |x| x > 5_f64, 5_u32)
|
||||
.await;
|
||||
let res_err = alice.wait_metric_with_timeout(BEST_BLOCK_METRIC, |x| x > 5_f64, 5_u32).await;
|
||||
|
||||
assert!(res_err.is_err());
|
||||
assert!(res_err.is_err());
|
||||
|
||||
alice.resume().await.unwrap();
|
||||
alice
|
||||
.wait_metric_with_timeout(BEST_BLOCK_METRIC, |x| x > 5_f64, 5_u32)
|
||||
.await
|
||||
.unwrap();
|
||||
alice.resume().await.unwrap();
|
||||
alice.wait_metric_with_timeout(BEST_BLOCK_METRIC, |x| x > 5_f64, 5_u32).await.unwrap();
|
||||
|
||||
// timeout connecting ws
|
||||
let collator = network.get_node("collator").unwrap();
|
||||
collator.pause().await.unwrap();
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
|
||||
// timeout connecting ws
|
||||
let collator = network.get_node("collator").unwrap();
|
||||
collator.pause().await.unwrap();
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
|
||||
|
||||
let r = collator
|
||||
.wait_client_with_timeout::<subxt::PolkadotConfig>(1_u32)
|
||||
.await;
|
||||
assert!(r.is_err());
|
||||
let r = collator.wait_client_with_timeout::<subxt::PolkadotConfig>(1_u32).await;
|
||||
assert!(r.is_err());
|
||||
|
||||
// tear down (optional if you don't detach the network)
|
||||
network.destroy().await.unwrap();
|
||||
// tear down (optional if you don't detach the network)
|
||||
network.destroy().await.unwrap();
|
||||
}
|
||||
|
||||
@@ -2,43 +2,43 @@ use zombienet_sdk::{environment::get_spawn_fn, NetworkConfigBuilder};
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn two_paras_same_id() {
|
||||
tracing_subscriber::fmt::init();
|
||||
let spawn_fn = get_spawn_fn();
|
||||
let config = NetworkConfigBuilder::new()
|
||||
.with_relaychain(|r| {
|
||||
r.with_chain("rococo-local")
|
||||
.with_default_command("polkadot")
|
||||
.with_default_image("docker.io/parity/polkadot:v1.7.0")
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
})
|
||||
.with_parachain(|p| {
|
||||
p.with_id(2000)
|
||||
.with_default_command("polkadot-parachain")
|
||||
.with_default_image("docker.io/parity/polkadot-parachain:1.7.0")
|
||||
.with_collator(|n| n.with_name("collator"))
|
||||
})
|
||||
.with_parachain(|p| {
|
||||
p.with_id(2000)
|
||||
.with_default_command("polkadot-parachain")
|
||||
.with_default_image("docker.io/parity/polkadot-parachain:1.7.0")
|
||||
.with_registration_strategy(zombienet_sdk::RegistrationStrategy::Manual)
|
||||
.with_collator(|n| n.with_name("collator1"))
|
||||
})
|
||||
.build()
|
||||
.unwrap();
|
||||
tracing_subscriber::fmt::init();
|
||||
let spawn_fn = get_spawn_fn();
|
||||
let config = NetworkConfigBuilder::new()
|
||||
.with_relaychain(|r| {
|
||||
r.with_chain("rococo-local")
|
||||
.with_default_command("polkadot")
|
||||
.with_default_image("docker.io/parity/polkadot:v1.7.0")
|
||||
.with_validator(|node| node.with_name("alice"))
|
||||
.with_validator(|node| node.with_name("bob"))
|
||||
})
|
||||
.with_parachain(|p| {
|
||||
p.with_id(2000)
|
||||
.with_default_command("polkadot-parachain")
|
||||
.with_default_image("docker.io/parity/polkadot-parachain:1.7.0")
|
||||
.with_collator(|n| n.with_name("collator"))
|
||||
})
|
||||
.with_parachain(|p| {
|
||||
p.with_id(2000)
|
||||
.with_default_command("polkadot-parachain")
|
||||
.with_default_image("docker.io/parity/polkadot-parachain:1.7.0")
|
||||
.with_registration_strategy(zombienet_sdk::RegistrationStrategy::Manual)
|
||||
.with_collator(|n| n.with_name("collator1"))
|
||||
})
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
let network = spawn_fn(config).await.unwrap();
|
||||
|
||||
assert!(network.get_node("collator").is_ok());
|
||||
assert!(network.get_node("collator1").is_ok());
|
||||
assert!(network.get_node("collator").is_ok());
|
||||
assert!(network.get_node("collator1").is_ok());
|
||||
|
||||
// First parachain (out of two) is fetched
|
||||
assert_eq!(network.parachain(2000).unwrap().unique_id(), "2000");
|
||||
// First parachain (out of two) is fetched
|
||||
assert_eq!(network.parachain(2000).unwrap().unique_id(), "2000");
|
||||
|
||||
// First and second parachain hav the same para_id
|
||||
assert_eq!(
|
||||
network.parachain_by_unique_id("2000").unwrap().para_id(),
|
||||
network.parachain_by_unique_id("2000-1").unwrap().para_id(),
|
||||
);
|
||||
// First and second parachain hav the same para_id
|
||||
assert_eq!(
|
||||
network.parachain_by_unique_id("2000").unwrap().para_id(),
|
||||
network.parachain_by_unique_id("2000-1").unwrap().para_id(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user