From ad7f21a94cff54783db9ef7f919cd6beef810e6c Mon Sep 17 00:00:00 2001 From: command-bot <> Date: Fri, 25 Oct 2024 11:26:16 +0000 Subject: [PATCH] ".git/.scripts/commands/fmt/fmt.sh" --- bridges/modules/xcm-bridge-hub-router/src/lib.rs | 14 +++++++++----- bridges/modules/xcm-bridge-hub-router/src/mock.rs | 4 +++- bridges/modules/xcm-bridge-hub/src/mock.rs | 11 ++++++++--- .../runtimes/assets/asset-hub-rococo/src/lib.rs | 10 ++++------ .../runtimes/assets/asset-hub-westend/src/lib.rs | 10 ++++------ 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/bridges/modules/xcm-bridge-hub-router/src/lib.rs b/bridges/modules/xcm-bridge-hub-router/src/lib.rs index 69cd63512547..1826d1528efb 100644 --- a/bridges/modules/xcm-bridge-hub-router/src/lib.rs +++ b/bridges/modules/xcm-bridge-hub-router/src/lib.rs @@ -23,8 +23,9 @@ //! queues are congested, it will eventually lead to increased queuing on this chain. //! //! **Note on Terminology**: When we refer to the bridge hub here, we mean the chain that -//! has the `pallet-bridge-messages` with an `ExportXcm` implementation deployed, e.g., provided by `pallet-xcm-bridge-hub`. -//! Depending on the deployment setup, `T::ToBridgeHubSender` can be configured accordingly - see `T::ToBridgeHubSender` for more documentation. +//! has the `pallet-bridge-messages` with an `ExportXcm` implementation deployed, e.g., provided by +//! `pallet-xcm-bridge-hub`. Depending on the deployment setup, `T::ToBridgeHubSender` can be +//! configured accordingly - see `T::ToBridgeHubSender` for more documentation. #![cfg_attr(not(feature = "std"), no_std)] @@ -97,8 +98,12 @@ pub mod pallet { type DestinationVersion: GetVersion; /// The bridge hub may be: - /// - A system (sibling) bridge hub parachain (or another chain), in which case we need an implementation for `T::ToBridgeHubSender` that sends `ExportMessage`, e.g., `SovereignPaidRemoteExporter`. - /// - The local chain, in which case we need an implementation for `T::ToBridgeHubSender` that does not use `ExportMessage` but instead directly calls the `ExportXcm` implementation. + /// - A system (sibling) bridge hub parachain (or another chain), in which case we need an + /// implementation for `T::ToBridgeHubSender` that sends `ExportMessage`, e.g., + /// `SovereignPaidRemoteExporter`. + /// - The local chain, in which case we need an implementation for `T::ToBridgeHubSender` + /// that does not use `ExportMessage` but instead directly calls the `ExportXcm` + /// implementation. type ToBridgeHubSender: SendXcm; /// Local XCM channel manager. type LocalXcmChannelManager: XcmChannelStatusProvider; @@ -229,7 +234,6 @@ pub mod pallet { } } - // This pallet acts as the `ExporterFor` for the `SovereignPaidRemoteExporter` to compute // message fee using fee factor. impl, I: 'static> ExporterFor for Pallet { diff --git a/bridges/modules/xcm-bridge-hub-router/src/mock.rs b/bridges/modules/xcm-bridge-hub-router/src/mock.rs index fd02ab14ae40..00919c9e9328 100644 --- a/bridges/modules/xcm-bridge-hub-router/src/mock.rs +++ b/bridges/modules/xcm-bridge-hub-router/src/mock.rs @@ -27,7 +27,9 @@ use frame_support::{ use sp_runtime::{traits::ConstU128, BuildStorage}; use sp_std::cell::RefCell; use xcm::prelude::*; -use xcm_builder::{InspectMessageQueues, NetworkExportTable, NetworkExportTableItem, SovereignPaidRemoteExporter}; +use xcm_builder::{ + InspectMessageQueues, NetworkExportTable, NetworkExportTableItem, SovereignPaidRemoteExporter, +}; type Block = frame_system::mocking::MockBlock; diff --git a/bridges/modules/xcm-bridge-hub/src/mock.rs b/bridges/modules/xcm-bridge-hub/src/mock.rs index 44137dfa9fc4..858561b450ba 100644 --- a/bridges/modules/xcm-bridge-hub/src/mock.rs +++ b/bridges/modules/xcm-bridge-hub/src/mock.rs @@ -208,7 +208,8 @@ impl pallet_xcm_bridge_hub::Config for TestRuntime { type BlobDispatcher = TestBlobDispatcher; } -/// A router instance simulates a scenario where the router is deployed on a different chain than the `MessageExporter`. This means that the router sends an `ExportMessage`. +/// A router instance simulates a scenario where the router is deployed on a different chain than +/// the `MessageExporter`. This means that the router sends an `ExportMessage`. impl pallet_xcm_bridge_hub_router::Config<()> for TestRuntime { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); @@ -219,10 +220,14 @@ impl pallet_xcm_bridge_hub_router::Config<()> for TestRuntime { type Bridges = NetworkExportTable; type DestinationVersion = AlwaysLatest; - // We use `SovereignPaidRemoteExporter` here to test and ensure that the `ExportMessage` produced by `pallet_xcm_bridge_hub_router` is compatible with the `ExportXcm` implementation of `pallet_xcm_bridge_hub`. + // We use `SovereignPaidRemoteExporter` here to test and ensure that the `ExportMessage` + // produced by `pallet_xcm_bridge_hub_router` is compatible with the `ExportXcm` implementation + // of `pallet_xcm_bridge_hub`. type ToBridgeHubSender = SovereignPaidRemoteExporter< XcmOverBridgeRouter, - // **Note**: The crucial part is that `ExportMessage` is processed by `XcmExecutor`, which calls the `ExportXcm` implementation of `pallet_xcm_bridge_hub` as the `MessageExporter`. + // **Note**: The crucial part is that `ExportMessage` is processed by `XcmExecutor`, which + // calls the `ExportXcm` implementation of `pallet_xcm_bridge_hub` as the + // `MessageExporter`. ExecuteXcmOverSendXcm, Self::UniversalLocation, >; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs index 178b8aee1e46..3c5d182a8536 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs @@ -934,12 +934,10 @@ impl pallet_xcm_bridge_hub_router::Config for Runtim type Bridges = xcm_config::bridging::NetworkExportTable; type DestinationVersion = PolkadotXcm; - // Let's use `SovereignPaidRemoteExporter`, which sends `ExportMessage` over HRMP to the sibling BridgeHub. - type ToBridgeHubSender = SovereignPaidRemoteExporter< - ToWestendXcmRouter, - XcmpQueue, - Self::UniversalLocation, - >; + // Let's use `SovereignPaidRemoteExporter`, which sends `ExportMessage` over HRMP to the sibling + // BridgeHub. + type ToBridgeHubSender = + SovereignPaidRemoteExporter; type LocalXcmChannelManager = cumulus_pallet_xcmp_queue::bridging::InAndOutXcmpChannelStatusProvider; diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index b286eb77e681..fa708b529514 100644 --- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -928,12 +928,10 @@ impl pallet_xcm_bridge_hub_router::Config for Runtime type Bridges = xcm_config::bridging::NetworkExportTable; type DestinationVersion = PolkadotXcm; - // Let's use `SovereignPaidRemoteExporter`, which sends `ExportMessage` over HRMP to the sibling BridgeHub. - type ToBridgeHubSender = SovereignPaidRemoteExporter< - ToRococoXcmRouter, - XcmpQueue, - Self::UniversalLocation, - >; + // Let's use `SovereignPaidRemoteExporter`, which sends `ExportMessage` over HRMP to the sibling + // BridgeHub. + type ToBridgeHubSender = + SovereignPaidRemoteExporter; type LocalXcmChannelManager = cumulus_pallet_xcmp_queue::bridging::InAndOutXcmpChannelStatusProvider;