mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 17:57:56 +00:00
Add JSON chainspecs for Wococo and Rococo Bridge-hub (#2473)
* add bridge-hub rococo and wococo chainspecs * use json chainspec for bridge-hub-rococo and bridge-hub-wococo * Removed unused functions --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com>
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -130,13 +130,10 @@ impl BridgeHubRuntimeType {
|
||||
Ok(Box::new(westend::BridgeHubChainSpec::from_json_bytes(
|
||||
&include_bytes!("../../../parachains/chain-specs/bridge-hub-westend.json")[..],
|
||||
)?)),
|
||||
BridgeHubRuntimeType::Rococo => Ok(Box::new(rococo::live_config(
|
||||
rococo::BRIDGE_HUB_ROCOCO,
|
||||
"Rococo BridgeHub",
|
||||
"rococo",
|
||||
ParaId::new(1013),
|
||||
|_| (),
|
||||
))),
|
||||
BridgeHubRuntimeType::Rococo =>
|
||||
Ok(Box::new(rococo::BridgeHubChainSpec::from_json_bytes(
|
||||
&include_bytes!("../../../parachains/chain-specs/bridge-hub-rococo.json")[..],
|
||||
)?)),
|
||||
BridgeHubRuntimeType::RococoLocal => Ok(Box::new(rococo::local_config(
|
||||
rococo::BRIDGE_HUB_ROCOCO_LOCAL,
|
||||
"Rococo BridgeHub Local",
|
||||
@@ -151,12 +148,10 @@ impl BridgeHubRuntimeType {
|
||||
ParaId::new(1013),
|
||||
|_| (),
|
||||
))),
|
||||
BridgeHubRuntimeType::Wococo => Ok(Box::new(wococo::live_config(
|
||||
wococo::BRIDGE_HUB_WOCOCO,
|
||||
"Wococo BridgeHub",
|
||||
"wococo",
|
||||
ParaId::new(1014),
|
||||
))),
|
||||
BridgeHubRuntimeType::Wococo =>
|
||||
Ok(Box::new(wococo::BridgeHubChainSpec::from_json_bytes(
|
||||
&include_bytes!("../../../parachains/chain-specs/bridge-hub-wococo.json")[..],
|
||||
)?)),
|
||||
BridgeHubRuntimeType::WococoLocal => Ok(Box::new(wococo::local_config(
|
||||
wococo::BRIDGE_HUB_WOCOCO_LOCAL,
|
||||
"Wococo BridgeHub Local",
|
||||
@@ -222,65 +217,6 @@ pub mod rococo {
|
||||
|
||||
pub type RuntimeApi = bridge_hub_rococo_runtime::RuntimeApi;
|
||||
|
||||
pub fn live_config<ModifyProperties: Fn(&mut sc_chain_spec::Properties)>(
|
||||
id: &str,
|
||||
chain_name: &str,
|
||||
relay_chain: &str,
|
||||
para_id: ParaId,
|
||||
modify_props: ModifyProperties,
|
||||
) -> BridgeHubChainSpec {
|
||||
// Rococo defaults
|
||||
let mut properties = sc_chain_spec::Properties::new();
|
||||
properties.insert("ss58Format".into(), 42.into());
|
||||
properties.insert("tokenSymbol".into(), "ROC".into());
|
||||
properties.insert("tokenDecimals".into(), 12.into());
|
||||
modify_props(&mut properties);
|
||||
|
||||
BridgeHubChainSpec::from_genesis(
|
||||
// Name
|
||||
chain_name,
|
||||
// ID
|
||||
super::ensure_id(id).expect("invalid id"),
|
||||
ChainType::Live,
|
||||
move || {
|
||||
genesis(
|
||||
// initial collators.
|
||||
vec![
|
||||
(
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_collator_keys_from_seed::<AuraId>("Alice"),
|
||||
),
|
||||
(
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_collator_keys_from_seed::<AuraId>("Bob"),
|
||||
),
|
||||
],
|
||||
vec![
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
|
||||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
|
||||
],
|
||||
para_id,
|
||||
)
|
||||
},
|
||||
Vec::new(),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
Some(properties),
|
||||
Extensions { relay_chain: relay_chain.to_string(), para_id: para_id.into() },
|
||||
)
|
||||
}
|
||||
|
||||
pub fn local_config<ModifyProperties: Fn(&mut sc_chain_spec::Properties)>(
|
||||
id: &str,
|
||||
chain_name: &str,
|
||||
@@ -403,17 +339,6 @@ pub mod wococo {
|
||||
properties.insert("tokenSymbol".into(), "WOOK".into());
|
||||
})
|
||||
}
|
||||
|
||||
pub fn live_config(
|
||||
id: &str,
|
||||
chain_name: &str,
|
||||
relay_chain: &str,
|
||||
para_id: ParaId,
|
||||
) -> BridgeHubChainSpec {
|
||||
rococo::live_config(id, chain_name, relay_chain, para_id, |properties| {
|
||||
properties.insert("tokenSymbol".into(), "WOOK".into());
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Sub-module for Kusama setup
|
||||
|
||||
Reference in New Issue
Block a user