From 7661e7c4a3d6161c70dd08047dcd8ed70907cae0 Mon Sep 17 00:00:00 2001 From: claravanstaden Date: Wed, 10 Jan 2024 15:52:27 +0200 Subject: [PATCH] remove config crates and move config --- Cargo.lock | 13 ------------- cumulus/parachains/common/src/rococo.rs | 13 +++++++++++++ .../tests/bridges/bridge-hub-rococo/Cargo.toml | 1 - .../runtimes/assets/asset-hub-rococo/Cargo.toml | 3 --- .../assets/asset-hub-rococo/src/xcm_config.rs | 2 +- .../bridge-hubs/bridge-hub-rococo/Cargo.toml | 9 +++------ .../bridge-hubs/bridge-hub-rococo/src/lib.rs | 2 +- .../parachains/runtimes/testing/penpal/Cargo.toml | 3 --- 8 files changed, 18 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef0a13128e85..5eb5d13d3d6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -906,7 +906,6 @@ dependencies = [ "rococo-runtime-constants", "scale-info", "smallvec", - "snowbridge-rococo-common", "snowbridge-router-primitives", "sp-api", "sp-block-builder", @@ -1988,7 +1987,6 @@ dependencies = [ "snowbridge-pallet-inbound-queue", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", - "snowbridge-rococo-common", "snowbridge-router-primitives", "sp-core", "sp-runtime", @@ -2067,7 +2065,6 @@ dependencies = [ "snowbridge-pallet-inbound-queue", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", - "snowbridge-rococo-common", "snowbridge-router-primitives", "snowbridge-runtime-common", "snowbridge-runtime-test-common", @@ -11646,7 +11643,6 @@ dependencies = [ "polkadot-runtime-common", "scale-info", "smallvec", - "snowbridge-rococo-common", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -17440,15 +17436,6 @@ dependencies = [ "staging-xcm-executor", ] -[[package]] -name = "snowbridge-rococo-common" -version = "0.9.0" -dependencies = [ - "frame-support", - "log", - "staging-xcm", -] - [[package]] name = "snowbridge-router-primitives" version = "0.9.0" diff --git a/cumulus/parachains/common/src/rococo.rs b/cumulus/parachains/common/src/rococo.rs index 6e31def4b55b..72e16927f38c 100644 --- a/cumulus/parachains/common/src/rococo.rs +++ b/cumulus/parachains/common/src/rococo.rs @@ -117,3 +117,16 @@ pub mod consensus { /// Relay chain slot duration, in milliseconds. pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000; } + +pub mod snowbridge { + use frame_support::parameter_types; + use xcm::opaque::lts::NetworkId; + + /// The pallet index of the Ethereum inbound queue pallet in the bridge hub runtime. + pub const INBOUND_QUEUE_PALLET_INDEX: u8 = 80; + + parameter_types! { + /// Network and location for the Ethereum chain. + pub EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: 11155111 }; + } +} diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml index f65248812164..78e5ab7673af 100644 --- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/Cargo.toml @@ -51,4 +51,3 @@ snowbridge-router-primitives = { path = "../../../../../../../../parachain/primi snowbridge-pallet-system = { path = "../../../../../../../../parachain/pallets/system", default-features = false } snowbridge-pallet-inbound-queue = { path = "../../../../../../../../parachain/pallets/inbound-queue", default-features = false } snowbridge-pallet-outbound-queue = { path = "../../../../../../../../parachain/pallets/outbound-queue", default-features = false } -snowbridge-rococo-common = { path = "../../../../../../../../parachain/runtime/rococo-common", default-features = false } diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml index cee1eaf6a6cc..71fdc8346c71 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml @@ -91,7 +91,6 @@ bp-asset-hub-westend = { path = "../../../../../bridges/primitives/chain-asset-h bp-bridge-hub-rococo = { path = "../../../../../bridges/primitives/chain-bridge-hub-rococo", default-features = false } bp-bridge-hub-westend = { path = "../../../../../bridges/primitives/chain-bridge-hub-westend", default-features = false } snowbridge-router-primitives = { path = "../../../../../../parachain/primitives/router", default-features = false } -snowbridge-rococo-common = { path = "../../../../../../parachain/runtime/rococo-common", default-features = false } [dev-dependencies] asset-test-utils = { path = "../test-utils" } @@ -139,7 +138,6 @@ runtime-benchmarks = [ "parachains-common/runtime-benchmarks", "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", - "snowbridge-rococo-common/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", @@ -231,7 +229,6 @@ std = [ "primitive-types/std", "rococo-runtime-constants/std", "scale-info/std", - "snowbridge-rococo-common/std", "snowbridge-router-primitives/std", "sp-api/std", "sp-block-builder/std", diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs index 63adcaf5458b..ea361118e09b 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/xcm_config.rs @@ -822,7 +822,7 @@ pub mod bridging { 1, X2( Parachain(SiblingBridgeHubParaId::get()), - PalletInstance(snowbridge_rococo_common::INBOUND_QUEUE_PALLET_INDEX) + PalletInstance(parachains_common::rococo::snowbridge::INBOUND_QUEUE_PALLET_INDEX) ) ); diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 141b65fe9cdd..8b71b2d6d835 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -117,7 +117,6 @@ snowbridge-pallet-outbound-queue = { path = "../../../../../../parachain/pallets snowbridge-outbound-queue-runtime-api = { path = "../../../../../../parachain/pallets/outbound-queue/runtime-api", default-features = false } snowbridge-router-primitives = { path = "../../../../../../parachain/primitives/router", default-features = false } snowbridge-runtime-common = { path = "../../../../../../parachain/runtime/runtime-common", default-features = false } -snowbridge-rococo-common = { path = "../../../../../../parachain/runtime/rococo-common", default-features = false } bridge-hub-common = { path = "../common", default-features = false } @@ -193,14 +192,13 @@ std = [ "serde", "snowbridge-beacon-primitives/std", "snowbridge-core/std", + "snowbridge-outbound-queue-runtime-api/std", "snowbridge-pallet-ethereum-client/std", "snowbridge-pallet-inbound-queue/std", "snowbridge-pallet-outbound-queue/std", - "snowbridge-outbound-queue-runtime-api/std", - "snowbridge-rococo-common/std", + "snowbridge-pallet-system/std", "snowbridge-router-primitives/std", "snowbridge-runtime-common/std", - "snowbridge-pallet-system/std", "snowbridge-system-runtime-api/std", "sp-api/std", "sp-block-builder/std", @@ -255,11 +253,10 @@ runtime-benchmarks = [ "snowbridge-pallet-ethereum-client/runtime-benchmarks", "snowbridge-pallet-inbound-queue/runtime-benchmarks", "snowbridge-pallet-outbound-queue/runtime-benchmarks", - "snowbridge-rococo-common/runtime-benchmarks", + "snowbridge-pallet-system/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", "snowbridge-runtime-common/runtime-benchmarks", "snowbridge-runtime-test-common/runtime-benchmarks", - "snowbridge-pallet-system/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 6a3c25634893..a64d8b26ec61 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -502,7 +502,7 @@ parameter_types! { parameter_types! { pub const CreateAssetCall: [u8;2] = [53, 0]; pub const CreateAssetDeposit: u128 = (UNITS / 10) + EXISTENTIAL_DEPOSIT; - pub const InboundQueuePalletInstance: u8 = snowbridge_rococo_common::INBOUND_QUEUE_PALLET_INDEX; + pub const InboundQueuePalletInstance: u8 = parachains_common::rococo::snowbridge::INBOUND_QUEUE_PALLET_INDEX; pub Parameters: PricingParameters = PricingParameters { exchange_rate: FixedU128::from_rational(1, 400), fee_per_gas: gwei(20), diff --git a/cumulus/parachains/runtimes/testing/penpal/Cargo.toml b/cumulus/parachains/runtimes/testing/penpal/Cargo.toml index bb0eef407d87..cc965c154c60 100644 --- a/cumulus/parachains/runtimes/testing/penpal/Cargo.toml +++ b/cumulus/parachains/runtimes/testing/penpal/Cargo.toml @@ -79,7 +79,6 @@ pallet-collator-selection = { path = "../../../../pallets/collator-selection", d parachain-info = { package = "staging-parachain-info", path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } assets-common = { path = "../../assets/common", default-features = false } -snowbridge-rococo-common = { path = "../../../../../../parachain/runtime/rococo-common", default-features = false } [features] default = ["std"] @@ -121,7 +120,6 @@ std = [ "polkadot-primitives/std", "polkadot-runtime-common/std", "scale-info/std", - "snowbridge-rococo-common/std", "sp-api/std", "sp-block-builder/std", "sp-consensus-aura/std", @@ -166,7 +164,6 @@ runtime-benchmarks = [ "polkadot-parachain-primitives/runtime-benchmarks", "polkadot-primitives/runtime-benchmarks", "polkadot-runtime-common/runtime-benchmarks", - "snowbridge-rococo-common/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks",