mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 19:11:02 +00:00
cumulus: add asset-hub-rococo runtime based on asset-hub-kusama and add asset-bridging support to it (#1215)
This commit adds Rococo Asset Hub dedicated runtime so we can test new features here, before merging them in Kusama Asset Hub. Also adds one such feature: asset transfer over bridge (Rococo AssetHub <> Wococo AssetHub) - clone `asset-hub-kusama-runtime` -> `asset-hub-rococo-runtime` - make it use Rococo primitives, names, assets, constants, etc - add asset-transfer-over-bridge support to Rococo AssetHub <> Wococo AssetHub Fixes #1128 --------- Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
This commit is contained in:
@@ -42,6 +42,8 @@ enum Runtime {
|
||||
Seedling,
|
||||
AssetHubPolkadot,
|
||||
AssetHubKusama,
|
||||
AssetHubRococo,
|
||||
AssetHubWococo,
|
||||
AssetHubWestend,
|
||||
Penpal(ParaId),
|
||||
ContractsRococo,
|
||||
@@ -90,6 +92,10 @@ fn runtime(id: &str) -> Runtime {
|
||||
Runtime::AssetHubPolkadot
|
||||
} else if id.starts_with("asset-hub-kusama") | id.starts_with("statemine") {
|
||||
Runtime::AssetHubKusama
|
||||
} else if id.starts_with("asset-hub-rococo") {
|
||||
Runtime::AssetHubRococo
|
||||
} else if id.starts_with("asset-hub-wococo") {
|
||||
Runtime::AssetHubWococo
|
||||
} else if id.starts_with("asset-hub-westend") | id.starts_with("westmint") {
|
||||
Runtime::AssetHubWestend
|
||||
} else if id.starts_with("penpal") {
|
||||
@@ -164,6 +170,31 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
|
||||
&include_bytes!("../chain-specs/asset-hub-kusama.json")[..],
|
||||
)?),
|
||||
|
||||
// -- Asset Hub Rococo
|
||||
"asset-hub-rococo-dev" =>
|
||||
Box::new(chain_spec::asset_hubs::asset_hub_rococo_development_config()),
|
||||
"asset-hub-rococo-local" =>
|
||||
Box::new(chain_spec::asset_hubs::asset_hub_rococo_local_config()),
|
||||
// the chain spec as used for generating the upgrade genesis values
|
||||
"asset-hub-rococo-genesis" => Box::new(chain_spec::asset_hubs::asset_hub_rococo_config()),
|
||||
// the shell-based chain spec as used for syncing
|
||||
"asset-hub-rococo" =>
|
||||
Box::new(chain_spec::asset_hubs::AssetHubRococoChainSpec::from_json_bytes(
|
||||
&include_bytes!("../chain-specs/asset-hub-rococo.json")[..],
|
||||
)?),
|
||||
|
||||
// -- Asset Hub Wococo
|
||||
"asset-hub-wococo-dev" =>
|
||||
Box::new(chain_spec::asset_hubs::asset_hub_wococo_development_config()),
|
||||
"asset-hub-wococo-local" =>
|
||||
Box::new(chain_spec::asset_hubs::asset_hub_wococo_local_config()),
|
||||
// the chain spec as used for generating the upgrade genesis values
|
||||
"asset-hub-wococo-genesis" => Box::new(chain_spec::asset_hubs::asset_hub_wococo_config()),
|
||||
"asset-hub-wococo" =>
|
||||
Box::new(chain_spec::asset_hubs::AssetHubWococoChainSpec::from_json_bytes(
|
||||
&include_bytes!("../chain-specs/asset-hub-wococo.json")[..],
|
||||
)?),
|
||||
|
||||
// -- Asset Hub Westend
|
||||
"asset-hub-westend-dev" | "westmint-dev" =>
|
||||
Box::new(chain_spec::asset_hubs::asset_hub_westend_development_config()),
|
||||
@@ -249,6 +280,10 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {
|
||||
),
|
||||
Runtime::AssetHubKusama =>
|
||||
Box::new(chain_spec::asset_hubs::AssetHubKusamaChainSpec::from_json_file(path)?),
|
||||
Runtime::AssetHubRococo =>
|
||||
Box::new(chain_spec::asset_hubs::AssetHubRococoChainSpec::from_json_file(path)?),
|
||||
Runtime::AssetHubWococo =>
|
||||
Box::new(chain_spec::asset_hubs::AssetHubWococoChainSpec::from_json_file(path)?),
|
||||
Runtime::AssetHubWestend => Box::new(
|
||||
chain_spec::asset_hubs::AssetHubWestendChainSpec::from_json_file(path)?,
|
||||
),
|
||||
@@ -391,6 +426,13 @@ macro_rules! construct_partials {
|
||||
)?;
|
||||
$code
|
||||
},
|
||||
Runtime::AssetHubRococo | Runtime::AssetHubWococo => {
|
||||
let $partials = new_partial::<asset_hub_rococo_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
crate::service::aura_build_import_queue::<_, AuraId>,
|
||||
)?;
|
||||
$code
|
||||
},
|
||||
Runtime::AssetHubWestend => {
|
||||
let $partials = new_partial::<asset_hub_westend_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
@@ -509,6 +551,16 @@ macro_rules! construct_async_run {
|
||||
{ $( $code )* }.map(|v| (v, task_manager))
|
||||
})
|
||||
},
|
||||
Runtime::AssetHubRococo | Runtime::AssetHubWococo => {
|
||||
runner.async_run(|$config| {
|
||||
let $components = new_partial::<asset_hub_rococo_runtime::RuntimeApi, _>(
|
||||
&$config,
|
||||
crate::service::aura_build_import_queue::<_, AuraId>,
|
||||
)?;
|
||||
let task_manager = $components.task_manager;
|
||||
{ $( $code )* }.map(|v| (v, task_manager))
|
||||
})
|
||||
},
|
||||
Runtime::AssetHubKusama => {
|
||||
runner.async_run(|$config| {
|
||||
let $components = new_partial::<asset_hub_kusama_runtime::RuntimeApi, _>(
|
||||
@@ -850,6 +902,13 @@ pub fn run() -> Result<()> {
|
||||
.await
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into),
|
||||
Runtime::AssetHubRococo | Runtime::AssetHubWococo => crate::service::start_asset_hub_node::<
|
||||
asset_hub_rococo_runtime::RuntimeApi,
|
||||
AuraId,
|
||||
>(config, polkadot_config, collator_options, id, hwbench)
|
||||
.await
|
||||
.map(|r| r.0)
|
||||
.map_err(Into::into),
|
||||
Runtime::AssetHubWestend => crate::service::start_asset_hub_node::<
|
||||
asset_hub_westend_runtime::RuntimeApi,
|
||||
AuraId,
|
||||
|
||||
Reference in New Issue
Block a user