Skip to content

Commit e4b6b8c

Browse files
authored
Add support for BHP local and BHK local (#3443)
Related to #3400 Extracting small parts of #3429 into separate PR: - Add support for BHP local and BHK local - Increase the timeout for the bridge zomienet tests
1 parent 9bf1a5e commit e4b6b8c

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

bridges/testing/tests/0001-asset-transfer/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
88
${BASH_SOURCE%/*}/../../environments/rococo-westend/spawn.sh --init --start-relayer &
99
env_pid=$!
1010

11-
ensure_process_file $env_pid $TEST_DIR/rococo.env 400
11+
ensure_process_file $env_pid $TEST_DIR/rococo.env 600
1212
rococo_dir=`cat $TEST_DIR/rococo.env`
1313
echo
1414

15-
ensure_process_file $env_pid $TEST_DIR/westend.env 180
15+
ensure_process_file $env_pid $TEST_DIR/westend.env 300
1616
westend_dir=`cat $TEST_DIR/westend.env`
1717
echo
1818

bridges/testing/tests/0002-mandatory-headers-synced-while-idle/run.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ source "${BASH_SOURCE%/*}/../../utils/zombienet.sh"
1010
${BASH_SOURCE%/*}/../../environments/rococo-westend/spawn.sh &
1111
env_pid=$!
1212

13-
ensure_process_file $env_pid $TEST_DIR/rococo.env 400
13+
ensure_process_file $env_pid $TEST_DIR/rococo.env 600
1414
rococo_dir=`cat $TEST_DIR/rococo.env`
1515
echo
1616

17-
ensure_process_file $env_pid $TEST_DIR/westend.env 180
17+
ensure_process_file $env_pid $TEST_DIR/westend.env 300
1818
westend_dir=`cat $TEST_DIR/westend.env`
1919
echo
2020

cumulus/polkadot-parachain/src/chain_spec/bridge_hubs.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ use std::str::FromStr;
2525
#[derive(Debug, PartialEq)]
2626
pub enum BridgeHubRuntimeType {
2727
Kusama,
28+
KusamaLocal,
29+
2830
Polkadot,
31+
PolkadotLocal,
2932

3033
Rococo,
3134
RococoLocal,
@@ -44,7 +47,9 @@ impl FromStr for BridgeHubRuntimeType {
4447
fn from_str(value: &str) -> Result<Self, Self::Err> {
4548
match value {
4649
polkadot::BRIDGE_HUB_POLKADOT => Ok(BridgeHubRuntimeType::Polkadot),
50+
polkadot::BRIDGE_HUB_POLKADOT_LOCAL => Ok(BridgeHubRuntimeType::PolkadotLocal),
4751
kusama::BRIDGE_HUB_KUSAMA => Ok(BridgeHubRuntimeType::Kusama),
52+
kusama::BRIDGE_HUB_KUSAMA_LOCAL => Ok(BridgeHubRuntimeType::KusamaLocal),
4853
westend::BRIDGE_HUB_WESTEND => Ok(BridgeHubRuntimeType::Westend),
4954
westend::BRIDGE_HUB_WESTEND_LOCAL => Ok(BridgeHubRuntimeType::WestendLocal),
5055
westend::BRIDGE_HUB_WESTEND_DEVELOPMENT => Ok(BridgeHubRuntimeType::WestendDevelopment),
@@ -103,6 +108,7 @@ impl BridgeHubRuntimeType {
103108
Some("Bob".to_string()),
104109
|_| (),
105110
))),
111+
other => Err(std::format!("No default config present for {:?}", other)),
106112
}
107113
}
108114
}
@@ -242,6 +248,7 @@ pub mod rococo {
242248
/// Sub-module for Kusama setup
243249
pub mod kusama {
244250
pub(crate) const BRIDGE_HUB_KUSAMA: &str = "bridge-hub-kusama";
251+
pub(crate) const BRIDGE_HUB_KUSAMA_LOCAL: &str = "bridge-hub-kusama-local";
245252
}
246253

247254
/// Sub-module for Westend setup.
@@ -358,4 +365,5 @@ pub mod westend {
358365
/// Sub-module for Polkadot setup
359366
pub mod polkadot {
360367
pub(crate) const BRIDGE_HUB_POLKADOT: &str = "bridge-hub-polkadot";
368+
pub(crate) const BRIDGE_HUB_POLKADOT_LOCAL: &str = "bridge-hub-polkadot-local";
361369
}

cumulus/polkadot-parachain/src/command.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,14 +755,16 @@ pub fn run() -> Result<()> {
755755
.map_err(Into::into),
756756

757757
BridgeHub(bridge_hub_runtime_type) => match bridge_hub_runtime_type {
758-
chain_spec::bridge_hubs::BridgeHubRuntimeType::Polkadot =>
758+
chain_spec::bridge_hubs::BridgeHubRuntimeType::Polkadot |
759+
chain_spec::bridge_hubs::BridgeHubRuntimeType::PolkadotLocal =>
759760
crate::service::start_generic_aura_node::<
760761
RuntimeApi,
761762
AuraId,
762763
>(config, polkadot_config, collator_options, id, hwbench)
763764
.await
764765
.map(|r| r.0),
765-
chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama =>
766+
chain_spec::bridge_hubs::BridgeHubRuntimeType::Kusama |
767+
chain_spec::bridge_hubs::BridgeHubRuntimeType::KusamaLocal =>
766768
crate::service::start_generic_aura_node::<
767769
RuntimeApi,
768770
AuraId,

0 commit comments

Comments
 (0)