Add support for BHP local and BHK local (#3443)

Related to https://github.com/paritytech/polkadot-sdk/issues/3400

Extracting small parts of
https://github.com/paritytech/polkadot-sdk/pull/3429 into separate PR:

- Add support for BHP local and BHK local
- Increase the timeout for the bridge zomienet tests
This commit is contained in:
Serban Iorga
2024-02-23 09:51:26 +01:00
committed by GitHub
parent 9bf1a5e238
commit e4b6b8cd79
4 changed files with 16 additions and 6 deletions
@@ -8,11 +8,11 @@ source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
${BASH_SOURCE%/*}/../../environments/rococo-westend/spawn.sh --init --start-relayer &
env_pid=$!
ensure_process_file $env_pid $TEST_DIR/rococo.env 400
ensure_process_file $env_pid $TEST_DIR/rococo.env 600
rococo_dir=`cat $TEST_DIR/rococo.env`
echo
ensure_process_file $env_pid $TEST_DIR/westend.env 180
ensure_process_file $env_pid $TEST_DIR/westend.env 300
westend_dir=`cat $TEST_DIR/westend.env`
echo
@@ -10,11 +10,11 @@ source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
${BASH_SOURCE%/*}/../../environments/rococo-westend/spawn.sh &
env_pid=$!
ensure_process_file $env_pid $TEST_DIR/rococo.env 400
ensure_process_file $env_pid $TEST_DIR/rococo.env 600
rococo_dir=`cat $TEST_DIR/rococo.env`
echo
ensure_process_file $env_pid $TEST_DIR/westend.env 180
ensure_process_file $env_pid $TEST_DIR/westend.env 300
westend_dir=`cat $TEST_DIR/westend.env`
echo
@@ -25,7 +25,10 @@ use std::str::FromStr;
#[derive(Debug, PartialEq)]
pub enum BridgeHubRuntimeType {
Kusama,
KusamaLocal,
Polkadot,
PolkadotLocal,
Rococo,
RococoLocal,
@@ -44,7 +47,9 @@ impl FromStr for BridgeHubRuntimeType {
fn from_str(value: &str) -> Result<Self, Self::Err> {
match value {
polkadot::BRIDGE_HUB_POLKADOT => Ok(BridgeHubRuntimeType::Polkadot),
polkadot::BRIDGE_HUB_POLKADOT_LOCAL => Ok(BridgeHubRuntimeType::PolkadotLocal),
kusama::BRIDGE_HUB_KUSAMA => Ok(BridgeHubRuntimeType::Kusama),
kusama::BRIDGE_HUB_KUSAMA_LOCAL => Ok(BridgeHubRuntimeType::KusamaLocal),
westend::BRIDGE_HUB_WESTEND => Ok(BridgeHubRuntimeType::Westend),
westend::BRIDGE_HUB_WESTEND_LOCAL => Ok(BridgeHubRuntimeType::WestendLocal),
westend::BRIDGE_HUB_WESTEND_DEVELOPMENT => Ok(BridgeHubRuntimeType::WestendDevelopment),
@@ -103,6 +108,7 @@ impl BridgeHubRuntimeType {
Some("Bob".to_string()),
|_| (),
))),
other => Err(std::format!("No default config present for {:?}", other)),
}
}
}
@@ -242,6 +248,7 @@ pub mod rococo {
/// Sub-module for Kusama setup
pub mod kusama {
pub(crate) const BRIDGE_HUB_KUSAMA: &str = "bridge-hub-kusama";
pub(crate) const BRIDGE_HUB_KUSAMA_LOCAL: &str = "bridge-hub-kusama-local";
}
/// Sub-module for Westend setup.
@@ -358,4 +365,5 @@ pub mod westend {
/// Sub-module for Polkadot setup
pub mod polkadot {
pub(crate) const BRIDGE_HUB_POLKADOT: &str = "bridge-hub-polkadot";
pub(crate) const BRIDGE_HUB_POLKADOT_LOCAL: &str = "bridge-hub-polkadot-local";
}
+4 -2
View File
@@ -755,14 +755,16 @@ pub fn run() -> Result<()> {
.map_err(Into::into),
BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type {
chain_spec::bridge_hubs::BridgeHubRuntimeType::Polkadot =>
chain_spec::bridge_hubs::BridgeHubRuntimeType::Polkadot |
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotLocal =>
crate::service::start_generic_aura_node::<
RuntimeApi,
AuraId,
>(config, polkadot_config, collator_options, id, hwbench)
.await
.map(|r| r.0),
chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama =>
chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama |
chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal =>
crate::service::start_generic_aura_node::<
RuntimeApi,
AuraId,