Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden authored and claravanstaden committed Nov 22, 2023
1 parent afe0a62 commit 7e866eb
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -907,10 +907,10 @@ impl pallet_xcm_bridge_hub_router::Config<ToEthereumXcmRouterInstance> for Runti

type ToBridgeHubSender = XcmpQueue;
type WithBridgeHubChannel =
cumulus_pallet_xcmp_queue::bridging::InAndOutXcmpChannelStatusProvider<
xcm_config::bridging::SiblingBridgeHubParaId,
Runtime,
>;
cumulus_pallet_xcmp_queue::bridging::InAndOutXcmpChannelStatusProvider<
xcm_config::bridging::SiblingBridgeHubParaId,
Runtime,
>;

type ByteFee = xcm_config::bridging::XcmBridgeHubRouterByteFee;
type FeeAsset = xcm_config::bridging::XcmBridgeHubRouterFeeAssetId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
use super::{
AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, BaseDeliveryFee,
FeeAssetId, ForeignAssets, ForeignAssetsInstance, ParachainInfo, ParachainSystem, PolkadotXcm,
PoolAssets, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, ToWestendXcmRouter,
TransactionByteFee, TrustBackedAssetsInstance, WeightToFee, XcmpQueue, ToEthereumXcmRouter
PoolAssets, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, ToEthereumXcmRouter,
ToWestendXcmRouter, TransactionByteFee, TrustBackedAssetsInstance, WeightToFee, XcmpQueue,
};
use assets_common::{
local_and_foreign_assets::MatchesLocalAndForeignAssetsMultiLocation,
Expand Down Expand Up @@ -557,7 +557,10 @@ impl xcm_executor::Config for XcmConfig {
// as reserve locations (we trust the Bridge Hub to relay the message that a reserve is being
// held). Asset Hub may _act_ as a reserve location for ROC and assets created
// under `pallet-assets`. Users must use teleport where allowed (e.g. ROC with the Relay Chain).
type IsReserve = (bridging::to_westend::IsTrustedBridgedReserveLocationForConcreteAsset, bridging::to_ethereum::IsTrustedBridgedReserveLocationForForeignAsset);
type IsReserve = (
bridging::to_westend::IsTrustedBridgedReserveLocationForConcreteAsset,
bridging::to_ethereum::IsTrustedBridgedReserveLocationForForeignAsset,
);
type IsTeleporter = TrustedTeleporters;
type UniversalLocation = UniversalLocation;
type Barrier = Barrier;
Expand Down Expand Up @@ -608,7 +611,8 @@ impl xcm_executor::Config for XcmConfig {
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
>;
type MessageExporter = ();
type UniversalAliases = (bridging::to_westend::UniversalAliases, bridging::to_ethereum::UniversalAliases);
type UniversalAliases =
(bridging::to_westend::UniversalAliases, bridging::to_ethereum::UniversalAliases);
type CallDispatcher = WithOriginFilter<SafeCallFilter>;
type SafeCallFilter = SafeCallFilter;
type Aliasers = Nothing;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

use crate::{
bridge_common_config::{BridgeParachainWestendInstance, DeliveryRewardInBalance},
weights, AccountId, BridgeWestendMessages, ParachainInfo, Runtime, RuntimeEvent, RuntimeOrigin,
XcmRouter,
weights,
xcm_config::{AgentIdOf, EthereumNetwork, UniversalLocation},
AccountId, BridgeWestendMessages, ParachainInfo, Runtime, RuntimeEvent, RuntimeOrigin,
XcmRouter,
};
use snowbridge_router_primitives::outbound::EthereumBlobExporter;
use bp_messages::LaneId;
use bridge_runtime_common::{
messages,
Expand All @@ -40,6 +40,7 @@ use bridge_runtime_common::{
RefundableMessagesLane, RefundableParachain,
},
};
use snowbridge_router_primitives::outbound::EthereumBlobExporter;

use codec::Encode;
use frame_support::{parameter_types, traits::PalletInfoAccess};
Expand Down Expand Up @@ -84,25 +85,25 @@ fn build_congestion_message<Call>(is_congested: bool) -> sp_std::vec::Vec<Instru
Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most:
bp_asset_hub_rococo::XcmBridgeHubRouterTransactCallMaxWeight::get(),
bp_asset_hub_rococo::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_rococo::Call::ToWestendXcmRouter(
bp_asset_hub_rococo::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested,
}
)
.encode()
.into(),
.encode()
.into(),
}
]
}

/// Proof of messages, coming from Westend.
pub type FromWestendBridgeHubMessagesProof =
FromBridgedChainMessagesProof<bp_bridge_hub_westend::Hash>;
FromBridgedChainMessagesProof<bp_bridge_hub_westend::Hash>;
/// Messages delivery proof for Rococo Bridge Hub -> Westend Bridge Hub messages.
pub type ToWestendBridgeHubMessagesDeliveryProof =
FromBridgedChainMessagesDeliveryProof<bp_bridge_hub_westend::Hash>;
FromBridgedChainMessagesDeliveryProof<bp_bridge_hub_westend::Hash>;

/// Dispatches received XCM messages from other bridge
type FromWestendMessageBlobDispatcher = BridgeBlobDispatcher<
Expand Down Expand Up @@ -155,11 +156,11 @@ impl MessageBridge for WithBridgeHubWestendMessageBridge {

/// Message verifier for BridgeHubWestend messages sent from BridgeHubRococo
pub type ToBridgeHubWestendMessageVerifier =
messages::source::FromThisChainMessageVerifier<WithBridgeHubWestendMessageBridge>;
messages::source::FromThisChainMessageVerifier<WithBridgeHubWestendMessageBridge>;

/// Maximal outbound payload size of BridgeHubRococo -> BridgeHubWestend messages.
pub type ToBridgeHubWestendMaximalOutboundPayloadSize =
messages::source::FromThisChainMaximalOutboundPayloadSize<WithBridgeHubWestendMessageBridge>;
messages::source::FromThisChainMaximalOutboundPayloadSize<WithBridgeHubWestendMessageBridge>;

/// BridgeHubWestend chain from message lane point of view.
#[derive(RuntimeDebug, Clone, Copy)]
Expand Down Expand Up @@ -301,18 +302,18 @@ mod tests {
},
messages_pallet_constants: AssertBridgeMessagesPalletConstants {
max_unrewarded_relayers_in_bridged_confirmation_tx:
bp_bridge_hub_westend::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
bp_bridge_hub_westend::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
max_unconfirmed_messages_in_bridged_confirmation_tx:
bp_bridge_hub_westend::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
bp_bridge_hub_westend::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
bridged_chain_id: bp_runtime::BRIDGE_HUB_WESTEND_CHAIN_ID,
},
pallet_names: AssertBridgePalletNames {
with_this_chain_messages_pallet_name:
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME,
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME,
with_bridged_chain_grandpa_pallet_name:
bp_westend::WITH_WESTEND_GRANDPA_PALLET_NAME,
bp_westend::WITH_WESTEND_GRANDPA_PALLET_NAME,
with_bridged_chain_messages_pallet_name:
bp_bridge_hub_westend::WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME,
bp_bridge_hub_westend::WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME,
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,25 @@ fn build_congestion_message<Call>(is_congested: bool) -> sp_std::vec::Vec<Instru
Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most:
bp_asset_hub_westend::XcmBridgeHubRouterTransactCallMaxWeight::get(),
bp_asset_hub_westend::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_westend::Call::ToRococoXcmRouter(
bp_asset_hub_westend::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested,
}
)
.encode()
.into(),
.encode()
.into(),
}
]
}

/// Proof of messages, coming from Rococo.
pub type FromRococoBridgeHubMessagesProof =
FromBridgedChainMessagesProof<bp_bridge_hub_rococo::Hash>;
FromBridgedChainMessagesProof<bp_bridge_hub_rococo::Hash>;
/// Messages delivery proof for Rococo Bridge Hub -> Westend Bridge Hub messages.
pub type ToRococoBridgeHubMessagesDeliveryProof =
FromBridgedChainMessagesDeliveryProof<bp_bridge_hub_rococo::Hash>;
FromBridgedChainMessagesDeliveryProof<bp_bridge_hub_rococo::Hash>;

/// Dispatches received XCM messages from other bridge
type FromRococoMessageBlobDispatcher = BridgeBlobDispatcher<
Expand Down Expand Up @@ -152,11 +152,11 @@ impl MessageBridge for WithBridgeHubRococoMessageBridge {

/// Message verifier for BridgeHubRococo messages sent from BridgeHubWestend
type ToBridgeHubRococoMessageVerifier =
messages::source::FromThisChainMessageVerifier<WithBridgeHubRococoMessageBridge>;
messages::source::FromThisChainMessageVerifier<WithBridgeHubRococoMessageBridge>;

/// Maximal outbound payload size of BridgeHubWestend -> BridgeHubRococo messages.
type ToBridgeHubRococoMaximalOutboundPayloadSize =
messages::source::FromThisChainMaximalOutboundPayloadSize<WithBridgeHubRococoMessageBridge>;
messages::source::FromThisChainMaximalOutboundPayloadSize<WithBridgeHubRococoMessageBridge>;

/// BridgeHubRococo chain from message lane point of view.
#[derive(RuntimeDebug, Clone, Copy)]
Expand Down Expand Up @@ -214,7 +214,7 @@ impl pallet_bridge_parachains::Config<BridgeParachainRococoInstance> for Runtime
type BridgesGrandpaPalletInstance = BridgeGrandpaRococoInstance;
type ParasPalletName = RococoBridgeParachainPalletName;
type ParaStoredHeaderDataBuilder =
SingleParaStoredHeaderDataBuilder<bp_bridge_hub_rococo::BridgeHubRococo>;
SingleParaStoredHeaderDataBuilder<bp_bridge_hub_rococo::BridgeHubRococo>;
type HeadsToKeep = ParachainHeadsToKeep;
type MaxParaHeadDataSize = MaxRococoParaHeadDataSize;
}
Expand Down Expand Up @@ -317,17 +317,17 @@ mod tests {
},
messages_pallet_constants: AssertBridgeMessagesPalletConstants {
max_unrewarded_relayers_in_bridged_confirmation_tx:
bp_bridge_hub_rococo::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
bp_bridge_hub_rococo::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX,
max_unconfirmed_messages_in_bridged_confirmation_tx:
bp_bridge_hub_rococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
bp_bridge_hub_rococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX,
bridged_chain_id: bp_runtime::BRIDGE_HUB_ROCOCO_CHAIN_ID,
},
pallet_names: AssertBridgePalletNames {
with_this_chain_messages_pallet_name:
bp_bridge_hub_westend::WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME,
bp_bridge_hub_westend::WITH_BRIDGE_HUB_WESTEND_MESSAGES_PALLET_NAME,
with_bridged_chain_grandpa_pallet_name: bp_rococo::WITH_ROCOCO_GRANDPA_PALLET_NAME,
with_bridged_chain_messages_pallet_name:
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME,
bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME,
},
});

Expand Down

0 comments on commit 7e866eb

Please sign in to comment.