diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs index b0526148fa3a..af2438efbcf4 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_ethereum_config.rs @@ -14,10 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use crate::{ - xcm_config::{AgentIdOf, UniversalLocation}, - Runtime, -}; +use crate::{xcm_config::UniversalLocation, Runtime}; use snowbridge_rococo_common::EthereumNetwork; use snowbridge_router_primitives::outbound::EthereumBlobExporter; @@ -26,5 +23,5 @@ pub type SnowbridgeExporter = EthereumBlobExporter< UniversalLocation, EthereumNetwork, snowbridge_outbound_queue::Pallet, - AgentIdOf, + snowbridge_core::AgentIdOf, >; 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 e752a1ec3e00..4f1c4c6e23f4 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 @@ -70,6 +70,7 @@ use frame_system::{ EnsureRoot, }; +use bp_runtime::HeaderId; #[cfg(not(feature = "runtime-benchmarks"))] use bridge_hub_common::BridgeHubMessageRouter; use bridge_hub_common::{ @@ -81,7 +82,6 @@ pub use sp_consensus_aura::sr25519::AuthorityId as AuraId; pub use sp_runtime::{MultiAddress, Perbill, Permill}; use xcm::VersionedMultiLocation; use xcm_config::{TreasuryAccount, XcmOriginToTransactDispatchOrigin, XcmRouter}; -use bp_runtime::HeaderId; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -630,7 +630,7 @@ impl snowbridge_system::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OutboundQueue = EthereumOutboundQueue; type SiblingOrigin = EnsureXcm; - type AgentIdOf = xcm_config::AgentIdOf; + type AgentIdOf = snowbridge_core::AgentIdOf; type TreasuryAccount = TreasuryAccount; type Token = Balances; type WeightInfo = weights::snowbridge_system::WeightInfo; diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs index aa90562dfc31..bf8891c97798 100644 --- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs +++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/xcm_config.rs @@ -47,10 +47,9 @@ use parachains_common::{ }; use polkadot_parachain_primitives::primitives::Sibling; use polkadot_runtime_common::xcm_sender::ExponentialPrice; -use snowbridge_core::DescribeHere; use snowbridge_rococo_common::EthereumNetwork; use snowbridge_runtime_common::XcmExportFeeToSibling; -use sp_core::{Get, H256}; +use sp_core::Get; use sp_runtime::traits::AccountIdConversion; use sp_std::marker::PhantomData; use xcm::latest::prelude::*; @@ -58,12 +57,11 @@ use xcm::latest::prelude::*; use xcm_builder::{ deposit_or_burn_fee, AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, - CurrencyAdapter, DenyReserveTransferToRelayChain, DenyThenTry, DescribeAllTerminal, - DescribeFamily, EnsureXcmOrigin, HandleFee, HashedDescription, IsConcrete, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, - SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, - TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, - XcmFeeToAccount, + CurrencyAdapter, DenyReserveTransferToRelayChain, DenyThenTry, EnsureXcmOrigin, HandleFee, + IsConcrete, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, + SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, + SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, + WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeToAccount, }; use xcm_executor::{ traits::{FeeManager, FeeReason, FeeReason::Export, TransactAsset, WithOriginFilter}, @@ -294,7 +292,7 @@ impl xcm_executor::Config for XcmConfig { MaxInstructions, >; type Trader = - UsingComponents>; + UsingComponents>; type ResponseHandler = PolkadotXcm; type AssetTrap = PolkadotXcm; type AssetLocker = (); @@ -336,7 +334,7 @@ impl xcm_executor::Config for XcmConfig { } pub type PriceForParentDelivery = -ExponentialPrice; + ExponentialPrice; /// Converts a local signed origin into an XCM multilocation. /// Forms the basis for local origins sending/executing XCMs. @@ -388,10 +386,6 @@ impl cumulus_pallet_xcm::Config for Runtime { type XcmExecutor = XcmExecutor; } -/// Creates an AgentId from a MultiLocation. An AgentId is a unique mapping to a Agent contract on -/// Ethereum which acts as the sovereign account for the MultiLocation. -pub type AgentIdOf = HashedDescription)>; - /// A `HandleFee` implementation that simply deposits the fees for `ExportMessage` XCM instructions /// into the accounts that are used for paying the relayer rewards. /// Burns the fees in case of a failure. @@ -404,19 +398,19 @@ pub struct XcmExportFeeToRelayerRewardAccounts< >(PhantomData<(AssetTransactor, DestNetwork, DestParaId, DestBridgedChainId, BridgeLaneId)>); impl< - AssetTransactor: TransactAsset, - DestNetwork: Get, - DestParaId: Get, - DestBridgedChainId: Get, - BridgeLaneId: Get, -> HandleFee -for XcmExportFeeToRelayerRewardAccounts< - AssetTransactor, - DestNetwork, - DestParaId, - DestBridgedChainId, - BridgeLaneId, -> + AssetTransactor: TransactAsset, + DestNetwork: Get, + DestParaId: Get, + DestBridgedChainId: Get, + BridgeLaneId: Get, + > HandleFee + for XcmExportFeeToRelayerRewardAccounts< + AssetTransactor, + DestNetwork, + DestParaId, + DestBridgedChainId, + BridgeLaneId, + > { fn handle_fee( fee: MultiAssets, @@ -489,7 +483,7 @@ pub struct XcmFeeManagerFromComponentsBridgeHub( PhantomData<(WaivedLocations, HandleFee)>, ); impl, FeeHandler: HandleFee> FeeManager -for XcmFeeManagerFromComponentsBridgeHub + for XcmFeeManagerFromComponentsBridgeHub { fn is_waived(origin: Option<&MultiLocation>, fee_reason: FeeReason) -> bool { let Some(loc) = origin else { return false };