From 85b39f3ac6c03df51d38f9a2e4585821fafe84f0 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 20 Mar 2024 14:06:01 +0100 Subject: [PATCH 1/4] Fixes --- Cargo.lock | 4 ---- .../emulated/tests/bridges/bridge-hub-kusama/Cargo.toml | 1 - .../emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml | 1 - system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml | 3 --- .../bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs | 2 +- system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml | 3 --- .../bridge-hubs/bridge-hub-polkadot/tests/snowbridge.rs | 2 +- 7 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2dd7cadce..98c89eeb72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1531,7 +1531,6 @@ dependencies = [ "scale-info", "snowbridge-beacon-primitives", "snowbridge-core", - "snowbridge-pallet-inbound-queue", "snowbridge-pallet-inbound-queue-fixtures", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", @@ -1611,7 +1610,6 @@ dependencies = [ "snowbridge-core", "snowbridge-outbound-queue-runtime-api", "snowbridge-pallet-ethereum-client", - "snowbridge-pallet-ethereum-client-fixtures", "snowbridge-pallet-inbound-queue", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", @@ -1681,7 +1679,6 @@ dependencies = [ "scale-info", "snowbridge-beacon-primitives", "snowbridge-core", - "snowbridge-pallet-inbound-queue", "snowbridge-pallet-inbound-queue-fixtures", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", @@ -1761,7 +1758,6 @@ dependencies = [ "snowbridge-core", "snowbridge-outbound-queue-runtime-api", "snowbridge-pallet-ethereum-client", - "snowbridge-pallet-ethereum-client-fixtures", "snowbridge-pallet-inbound-queue", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml index d5026de550..0020e6ded6 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml @@ -49,5 +49,4 @@ snowbridge-core = { version = "0.1.0" } snowbridge-router-primitives = { version = "0.1.0" } snowbridge-pallet-system = { version = "0.1.0" } snowbridge-pallet-outbound-queue = { version = "0.1.0" } -snowbridge-pallet-inbound-queue = { version = "0.1.0" } snowbridge-pallet-inbound-queue-fixtures = { version = "0.9.0" } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml index a33deaa4aa..9ff3bf18f4 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml @@ -49,5 +49,4 @@ snowbridge-core = { version = "0.1.0" } snowbridge-router-primitives = { version = "0.1.0" } snowbridge-pallet-system = { version = "0.1.0" } snowbridge-pallet-outbound-queue = { version = "0.1.0" } -snowbridge-pallet-inbound-queue = { version = "0.1.0" } snowbridge-pallet-inbound-queue-fixtures = { version = "0.9.0" } diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml index a7b2bd66a2..02ced15d47 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -107,7 +107,6 @@ snowbridge-pallet-system = { default-features = false , version = "0.1.0" } snowbridge-system-runtime-api = { default-features = false , version = "0.1.0" } snowbridge-core = { default-features = false , version = "0.1.0" } snowbridge-pallet-ethereum-client = { default-features = false , version = "0.1.0" } -snowbridge-pallet-ethereum-client-fixtures = { default-features = false , version = "0.9.0" } snowbridge-pallet-inbound-queue = { default-features = false , version = "0.1.0" } snowbridge-pallet-outbound-queue = { default-features = false , version = "0.1.0" } snowbridge-outbound-queue-runtime-api = { default-features = false , version = "0.1.0" } @@ -187,7 +186,6 @@ std = [ "snowbridge-beacon-primitives/std", "snowbridge-core/std", "snowbridge-pallet-ethereum-client/std", - "snowbridge-pallet-ethereum-client-fixtures/std", "snowbridge-pallet-inbound-queue/std", "snowbridge-outbound-queue-runtime-api/std", "snowbridge-pallet-outbound-queue/std", @@ -246,7 +244,6 @@ runtime-benchmarks = [ "polkadot-runtime-common/runtime-benchmarks", "snowbridge-core/runtime-benchmarks", "snowbridge-pallet-ethereum-client/runtime-benchmarks", - "snowbridge-pallet-ethereum-client-fixtures/runtime-benchmarks", "snowbridge-pallet-inbound-queue/runtime-benchmarks", "snowbridge-pallet-outbound-queue/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs index b997006074..18ad72c0a4 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/tests/snowbridge.rs @@ -18,6 +18,7 @@ use bp_polkadot_core::Signature; use bridge_hub_kusama_runtime::{ + bridge_to_ethereum_config::EthereumNetwork, bridge_to_polkadot_config::RefundBridgeHubPolkadotMessages, xcm_config::{XcmConfig, XcmFeeManagerFromComponentsBridgeHub}, BridgeRejectObsoleteHeadersAndMessages, Executive, MessageQueueServiceWeight, Runtime, @@ -48,7 +49,6 @@ use sp_runtime::{ traits::Header, AccountId32, FixedU128, Saturating, }; -use system_parachains_constants::kusama::snowbridge::EthereumNetwork; use xcm::{latest::prelude::*, v3::Error}; use xcm_builder::HandleFee; use xcm_executor::{ diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml index 56b6d46e66..2533ea4ed3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/Cargo.toml @@ -107,7 +107,6 @@ snowbridge-pallet-system = { default-features = false , version = "0.1.0" } snowbridge-system-runtime-api = { default-features = false , version = "0.1.0" } snowbridge-core = { default-features = false , version = "0.1.0" } snowbridge-pallet-ethereum-client = { default-features = false , version = "0.1.0" } -snowbridge-pallet-ethereum-client-fixtures = { default-features = false , version = "0.9.0" } snowbridge-pallet-inbound-queue = { default-features = false , version = "0.1.0" } snowbridge-pallet-outbound-queue = { default-features = false , version = "0.1.0" } snowbridge-outbound-queue-runtime-api = { default-features = false , version = "0.1.0" } @@ -187,7 +186,6 @@ std = [ "snowbridge-beacon-primitives/std", "snowbridge-core/std", "snowbridge-pallet-ethereum-client/std", - "snowbridge-pallet-ethereum-client-fixtures/std", "snowbridge-pallet-inbound-queue/std", "snowbridge-outbound-queue-runtime-api/std", "snowbridge-pallet-outbound-queue/std", @@ -246,7 +244,6 @@ runtime-benchmarks = [ "polkadot-runtime-common/runtime-benchmarks", "snowbridge-core/runtime-benchmarks", "snowbridge-pallet-ethereum-client/runtime-benchmarks", - "snowbridge-pallet-ethereum-client-fixtures/runtime-benchmarks", "snowbridge-pallet-inbound-queue/runtime-benchmarks", "snowbridge-pallet-outbound-queue/runtime-benchmarks", "snowbridge-router-primitives/runtime-benchmarks", diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/snowbridge.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/snowbridge.rs index 221c925a23..be84c05cf3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/snowbridge.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/tests/snowbridge.rs @@ -18,6 +18,7 @@ use bp_polkadot_core::Signature; use bridge_hub_polkadot_runtime::{ + bridge_to_ethereum_config::EthereumNetwork, bridge_to_kusama_config::RefundBridgeHubKusamaMessages, xcm_config::{XcmConfig, XcmFeeManagerFromComponentsBridgeHub}, BridgeRejectObsoleteHeadersAndMessages, Executive, MessageQueueServiceWeight, Runtime, @@ -48,7 +49,6 @@ use sp_runtime::{ traits::Header, AccountId32, FixedU128, Saturating, }; -use system_parachains_constants::polkadot::snowbridge::EthereumNetwork; use xcm::{latest::prelude::*, v3::Error}; use xcm_builder::HandleFee; use xcm_executor::{ From e7f9bb5f6b7c76855931aae9652d0a2dea1b41f5 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 20 Mar 2024 14:11:31 +0100 Subject: [PATCH 2/4] Revert back deps --- Cargo.lock | 2 ++ .../emulated/tests/bridges/bridge-hub-kusama/Cargo.toml | 1 + .../emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 98c89eeb72..d26eacaaba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1539,6 +1539,7 @@ dependencies = [ "sp-runtime", "staging-xcm", "staging-xcm-executor", + "system-parachains-constants", ] [[package]] @@ -1687,6 +1688,7 @@ dependencies = [ "sp-runtime", "staging-xcm", "staging-xcm-executor", + "system-parachains-constants", ] [[package]] diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml index 0020e6ded6..b4a9ae2cb7 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/Cargo.toml @@ -42,6 +42,7 @@ asset-hub-kusama-runtime = { path = "../../../../../system-parachains/asset-hubs integration-tests-helpers = { path = "../../../helpers" } kusama-polkadot-system-emulated-network = { path = "../../../networks/kusama-polkadot-system" } kusama-system-emulated-network = { path = "../../../networks/kusama-system" } +system-parachains-constants = { path = "../../../../../system-parachains/constants" } # Snowbridge snowbridge-beacon-primitives = { version = "0.1.0" } diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml index 9ff3bf18f4..d7fa7a7aa8 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/Cargo.toml @@ -35,13 +35,14 @@ cumulus-pallet-xcmp-queue = { version = "0.8.0" } bp-messages = { version = "0.8.0" } pallet-bridge-messages = { version = "0.8.0" } -# Runtimes +# Local bp-bridge-hub-polkadot = { path = "../../../../../system-parachains/bridge-hubs/bridge-hub-polkadot/primitives"} bridge-hub-polkadot-runtime = { path = "../../../../../system-parachains/bridge-hubs/bridge-hub-polkadot" } asset-hub-polkadot-runtime = { path = "../../../../../system-parachains/asset-hubs/asset-hub-polkadot" } integration-tests-helpers = { path = "../../../helpers" } kusama-polkadot-system-emulated-network = { path = "../../../networks/kusama-polkadot-system" } polkadot-system-emulated-network = { path = "../../../networks/polkadot-system" } +system-parachains-constants = { path = "../../../../../system-parachains/constants" } # Snowbridge snowbridge-beacon-primitives = { version = "0.1.0" } From dc9e6bce39a4ce5c8ee481fffb867cb013a7f0fc Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 20 Mar 2024 14:14:20 +0100 Subject: [PATCH 3/4] Unused import --- .../tests/bridges/bridge-hub-kusama/src/tests/snowbridge.rs | 2 +- .../tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/snowbridge.rs b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/snowbridge.rs index 6a3c64fc5a..1e55bcc7bb 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/snowbridge.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-kusama/src/tests/snowbridge.rs @@ -22,7 +22,7 @@ use bridge_hub_kusama_runtime::{ }; use codec::{Decode, Encode}; use emulated_integration_tests_common::xcm_emulator::ConvertLocation; -use frame_support::{pallet_prelude::TypeInfo, traits::PalletInfoAccess}; +use frame_support::pallet_prelude::TypeInfo; use hex_literal::hex; use kusama_system_emulated_network::{ penpal_emulated_chain::CustomizableAssetFromSystemAssetHub, diff --git a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs index bb48b47972..3cbeadf3f7 100644 --- a/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs +++ b/integration-tests/emulated/tests/bridges/bridge-hub-polkadot/src/tests/snowbridge.rs @@ -22,7 +22,7 @@ use bridge_hub_polkadot_runtime::{ }; use codec::{Decode, Encode}; use emulated_integration_tests_common::xcm_emulator::ConvertLocation; -use frame_support::{pallet_prelude::TypeInfo, traits::PalletInfoAccess}; +use frame_support::pallet_prelude::TypeInfo; use hex_literal::hex; use polkadot_system_emulated_network::{ penpal_emulated_chain::CustomizableAssetFromSystemAssetHub, From 3cf807ad718ad3ee64dce72d7c8c8417146a01cf Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 20 Mar 2024 15:37:04 +0100 Subject: [PATCH 4/4] Remove import and use directly --- .../bridge-hubs/bridge-hub-kusama/src/lib.rs | 9 ++------- .../bridge-hubs/bridge-hub-polkadot/src/lib.rs | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs index 1c04ad1d62..466d8bc94a 100644 --- a/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -68,8 +68,6 @@ use frame_system::{ use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; -#[cfg(not(feature = "runtime-benchmarks"))] -use xcm_config::XcmRouter; use xcm_config::{ FellowshipLocation, GovernanceLocation, TreasuryAccount, XcmOriginToTransactDispatchOrigin, }; @@ -95,9 +93,6 @@ use system_parachains_constants::{ // XCM Imports use xcm::prelude::*; -#[cfg(feature = "runtime-benchmarks")] -use benchmark_helpers::DoNothingRouter; - /// The address format for describing accounts. pub type Address = MultiAddress; @@ -553,9 +548,9 @@ impl snowbridge_pallet_inbound_queue::Config for Runtime { type Verifier = snowbridge_pallet_ethereum_client::Pallet; type Token = Balances; #[cfg(not(feature = "runtime-benchmarks"))] - type XcmSender = XcmRouter; + type XcmSender = xcm_config::XcmRouter; #[cfg(feature = "runtime-benchmarks")] - type XcmSender = DoNothingRouter; + type XcmSender = benchmark_helpers::DoNothingRouter; type ChannelLookup = EthereumSystem; type GatewayAddress = EthereumGatewayAddress; #[cfg(feature = "runtime-benchmarks")] diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index f4f3df924c..6280cd7150 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -68,8 +68,6 @@ use frame_system::{ use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; -#[cfg(not(feature = "runtime-benchmarks"))] -use xcm_config::XcmRouter; use xcm_config::{ FellowshipLocation, GovernanceLocation, TreasuryAccount, XcmOriginToTransactDispatchOrigin, }; @@ -96,9 +94,6 @@ use system_parachains_constants::{ // XCM Imports use xcm::prelude::*; -#[cfg(feature = "runtime-benchmarks")] -use benchmark_helpers::DoNothingRouter; - /// The address format for describing accounts. pub type Address = MultiAddress; @@ -554,9 +549,9 @@ impl snowbridge_pallet_inbound_queue::Config for Runtime { type Verifier = snowbridge_pallet_ethereum_client::Pallet; type Token = Balances; #[cfg(not(feature = "runtime-benchmarks"))] - type XcmSender = XcmRouter; + type XcmSender = xcm_config::XcmRouter; #[cfg(feature = "runtime-benchmarks")] - type XcmSender = DoNothingRouter; + type XcmSender = benchmark_helpers::DoNothingRouter; type ChannelLookup = EthereumSystem; type GatewayAddress = EthereumGatewayAddress; #[cfg(feature = "runtime-benchmarks")]