From 78894757c779e62898c7381b167ab976762220df Mon Sep 17 00:00:00 2001 From: Morgan Adamiec Date: Mon, 7 Aug 2023 21:28:06 +0100 Subject: [PATCH] Symlink chain-specs json files to crate where they are used When publishing crates, each crate becomes it's own tarball that can't access files from other crates. So symlink the files to be crate local and cargo will replace the symlinks with real files at publish time. --- .../chain-specs/asset-hub-kusama.json | 1 + .../chain-specs/asset-hub-polkadot.json | 1 + .../chain-specs/asset-hub-westend.json | 1 + .../chain-specs/bridge-hub-kusama.json | 1 + .../chain-specs/bridge-hub-polkadot.json | 1 + .../chain-specs/bridge-hub-rococo.json | 1 + .../chain-specs/bridge-hub-westend.json | 1 + .../chain-specs/bridge-hub-wococo.json | 1 + .../chain-specs/collectives-polkadot.json | 1 + .../chain-specs/collectives-westend.json | 1 + .../chain-specs/contracts-rococo.json | 1 + polkadot-parachain/chain-specs/tick.json | 1 + polkadot-parachain/chain-specs/track.json | 1 + polkadot-parachain/chain-specs/trick.json | 1 + .../src/chain_spec/bridge_hubs.rs | 10 +++++----- polkadot-parachain/src/command.rs | 18 +++++++++--------- 16 files changed, 28 insertions(+), 14 deletions(-) create mode 120000 polkadot-parachain/chain-specs/asset-hub-kusama.json create mode 120000 polkadot-parachain/chain-specs/asset-hub-polkadot.json create mode 120000 polkadot-parachain/chain-specs/asset-hub-westend.json create mode 120000 polkadot-parachain/chain-specs/bridge-hub-kusama.json create mode 120000 polkadot-parachain/chain-specs/bridge-hub-polkadot.json create mode 120000 polkadot-parachain/chain-specs/bridge-hub-rococo.json create mode 120000 polkadot-parachain/chain-specs/bridge-hub-westend.json create mode 120000 polkadot-parachain/chain-specs/bridge-hub-wococo.json create mode 120000 polkadot-parachain/chain-specs/collectives-polkadot.json create mode 120000 polkadot-parachain/chain-specs/collectives-westend.json create mode 120000 polkadot-parachain/chain-specs/contracts-rococo.json create mode 120000 polkadot-parachain/chain-specs/tick.json create mode 120000 polkadot-parachain/chain-specs/track.json create mode 120000 polkadot-parachain/chain-specs/trick.json diff --git a/polkadot-parachain/chain-specs/asset-hub-kusama.json b/polkadot-parachain/chain-specs/asset-hub-kusama.json new file mode 120000 index 00000000000..89a3015b50a --- /dev/null +++ b/polkadot-parachain/chain-specs/asset-hub-kusama.json @@ -0,0 +1 @@ +../../parachains/chain-specs/asset-hub-kusama.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/asset-hub-polkadot.json b/polkadot-parachain/chain-specs/asset-hub-polkadot.json new file mode 120000 index 00000000000..43a1cb41131 --- /dev/null +++ b/polkadot-parachain/chain-specs/asset-hub-polkadot.json @@ -0,0 +1 @@ +../../parachains/chain-specs/asset-hub-polkadot.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/asset-hub-westend.json b/polkadot-parachain/chain-specs/asset-hub-westend.json new file mode 120000 index 00000000000..03742c40162 --- /dev/null +++ b/polkadot-parachain/chain-specs/asset-hub-westend.json @@ -0,0 +1 @@ +../../parachains/chain-specs/asset-hub-westend.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/bridge-hub-kusama.json b/polkadot-parachain/chain-specs/bridge-hub-kusama.json new file mode 120000 index 00000000000..fc91654c6ff --- /dev/null +++ b/polkadot-parachain/chain-specs/bridge-hub-kusama.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-kusama.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/bridge-hub-polkadot.json b/polkadot-parachain/chain-specs/bridge-hub-polkadot.json new file mode 120000 index 00000000000..df22d3e8800 --- /dev/null +++ b/polkadot-parachain/chain-specs/bridge-hub-polkadot.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-polkadot.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/bridge-hub-rococo.json b/polkadot-parachain/chain-specs/bridge-hub-rococo.json new file mode 120000 index 00000000000..8970d92bcf5 --- /dev/null +++ b/polkadot-parachain/chain-specs/bridge-hub-rococo.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-rococo.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/bridge-hub-westend.json b/polkadot-parachain/chain-specs/bridge-hub-westend.json new file mode 120000 index 00000000000..9f9e4dad5c1 --- /dev/null +++ b/polkadot-parachain/chain-specs/bridge-hub-westend.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-westend.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/bridge-hub-wococo.json b/polkadot-parachain/chain-specs/bridge-hub-wococo.json new file mode 120000 index 00000000000..e13ab77265d --- /dev/null +++ b/polkadot-parachain/chain-specs/bridge-hub-wococo.json @@ -0,0 +1 @@ +../../parachains/chain-specs/bridge-hub-wococo.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/collectives-polkadot.json b/polkadot-parachain/chain-specs/collectives-polkadot.json new file mode 120000 index 00000000000..afece75567b --- /dev/null +++ b/polkadot-parachain/chain-specs/collectives-polkadot.json @@ -0,0 +1 @@ +../../parachains/chain-specs/collectives-polkadot.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/collectives-westend.json b/polkadot-parachain/chain-specs/collectives-westend.json new file mode 120000 index 00000000000..84e23b06fb4 --- /dev/null +++ b/polkadot-parachain/chain-specs/collectives-westend.json @@ -0,0 +1 @@ +../../parachains/chain-specs/collectives-westend.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/contracts-rococo.json b/polkadot-parachain/chain-specs/contracts-rococo.json new file mode 120000 index 00000000000..b9f8e8f31e8 --- /dev/null +++ b/polkadot-parachain/chain-specs/contracts-rococo.json @@ -0,0 +1 @@ +../../parachains/chain-specs/contracts-rococo.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/tick.json b/polkadot-parachain/chain-specs/tick.json new file mode 120000 index 00000000000..47c93a98405 --- /dev/null +++ b/polkadot-parachain/chain-specs/tick.json @@ -0,0 +1 @@ +../../parachains/chain-specs/tick.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/track.json b/polkadot-parachain/chain-specs/track.json new file mode 120000 index 00000000000..9474c223a94 --- /dev/null +++ b/polkadot-parachain/chain-specs/track.json @@ -0,0 +1 @@ +../../parachains/chain-specs/track.json \ No newline at end of file diff --git a/polkadot-parachain/chain-specs/trick.json b/polkadot-parachain/chain-specs/trick.json new file mode 120000 index 00000000000..de1fb9edf30 --- /dev/null +++ b/polkadot-parachain/chain-specs/trick.json @@ -0,0 +1 @@ +../../parachains/chain-specs/trick.json \ No newline at end of file diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index 911368073d5..5f5d07ae7ff 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -97,7 +97,7 @@ impl BridgeHubRuntimeType { match self { BridgeHubRuntimeType::Polkadot => Ok(Box::new(polkadot::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-polkadot.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-polkadot.json")[..], )?)), BridgeHubRuntimeType::PolkadotLocal => Ok(Box::new(polkadot::local_config( polkadot::BRIDGE_HUB_POLKADOT_LOCAL, @@ -113,7 +113,7 @@ impl BridgeHubRuntimeType { ))), BridgeHubRuntimeType::Kusama => Ok(Box::new(kusama::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-kusama.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-kusama.json")[..], )?)), BridgeHubRuntimeType::KusamaLocal => Ok(Box::new(kusama::local_config( kusama::BRIDGE_HUB_KUSAMA_LOCAL, @@ -129,11 +129,11 @@ impl BridgeHubRuntimeType { ))), BridgeHubRuntimeType::Westend => Ok(Box::new(westend::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-westend.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-westend.json")[..], )?)), BridgeHubRuntimeType::Rococo => Ok(Box::new(rococo::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-rococo.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-rococo.json")[..], )?)), BridgeHubRuntimeType::RococoLocal => Ok(Box::new(rococo::local_config( rococo::BRIDGE_HUB_ROCOCO_LOCAL, @@ -153,7 +153,7 @@ impl BridgeHubRuntimeType { ))), BridgeHubRuntimeType::Wococo => Ok(Box::new(wococo::BridgeHubChainSpec::from_json_bytes( - &include_bytes!("../../../parachains/chain-specs/bridge-hub-wococo.json")[..], + &include_bytes!("../../chain-specs/bridge-hub-wococo.json")[..], )?)), BridgeHubRuntimeType::WococoLocal => Ok(Box::new(wococo::local_config( wococo::BRIDGE_HUB_WOCOCO_LOCAL, diff --git a/polkadot-parachain/src/command.rs b/polkadot-parachain/src/command.rs index 42ae887db6e..f619df0bff0 100644 --- a/polkadot-parachain/src/command.rs +++ b/polkadot-parachain/src/command.rs @@ -121,15 +121,15 @@ fn load_spec(id: &str) -> std::result::Result, String> { Box::new(chain_spec::rococo_parachain::staging_rococo_parachain_local_config()), "tick" => Box::new(chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/tick.json")[..], + &include_bytes!("../chain-specs/tick.json")[..], )?), "trick" => Box::new(chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/trick.json")[..], + &include_bytes!("../chain-specs/trick.json")[..], )?), "track" => Box::new(chain_spec::rococo_parachain::RococoParachainChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/track.json")[..], + &include_bytes!("../chain-specs/track.json")[..], )?), // -- Starters @@ -147,7 +147,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { // the shell-based chain spec as used for syncing "asset-hub-polkadot" | "statemint" => Box::new(chain_spec::asset_hubs::AssetHubPolkadotChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/asset-hub-polkadot.json")[..], + &include_bytes!("../chain-specs/asset-hub-polkadot.json")[..], )?), // -- Asset Hub Kusama @@ -161,7 +161,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { // the shell-based chain spec as used for syncing "asset-hub-kusama" | "statemine" => Box::new(chain_spec::asset_hubs::AssetHubKusamaChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/asset-hub-kusama.json")[..], + &include_bytes!("../chain-specs/asset-hub-kusama.json")[..], )?), // -- Asset Hub Westend @@ -175,7 +175,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { // the shell-based chain spec as used for syncing "asset-hub-westend" | "westmint" => Box::new(chain_spec::asset_hubs::AssetHubWestendChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/asset-hub-westend.json")[..], + &include_bytes!("../chain-specs/asset-hub-westend.json")[..], )?), // -- Polkadot Collectives @@ -185,11 +185,11 @@ fn load_spec(id: &str) -> std::result::Result, String> { Box::new(chain_spec::collectives::collectives_polkadot_local_config()), "collectives-polkadot" => Box::new(chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/collectives-polkadot.json")[..], + &include_bytes!("../chain-specs/collectives-polkadot.json")[..], )?), "collectives-westend" => Box::new(chain_spec::collectives::CollectivesPolkadotChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/collectives-westend.json")[..], + &include_bytes!("../chain-specs/collectives-westend.json")[..], )?), // -- Contracts on Rococo @@ -200,7 +200,7 @@ fn load_spec(id: &str) -> std::result::Result, String> { "contracts-rococo-genesis" => Box::new(chain_spec::contracts::contracts_rococo_config()), "contracts-rococo" => Box::new(chain_spec::contracts::ContractsRococoChainSpec::from_json_bytes( - &include_bytes!("../../parachains/chain-specs/contracts-rococo.json")[..], + &include_bytes!("../chain-specs/contracts-rococo.json")[..], )?), // -- BridgeHub