diff --git a/bridges/bin/millau/runtime/src/rialto_messages.rs b/bridges/bin/millau/runtime/src/rialto_messages.rs index c989de67b1..c6bc308a8e 100644 --- a/bridges/bin/millau/runtime/src/rialto_messages.rs +++ b/bridges/bin/millau/runtime/src/rialto_messages.rs @@ -116,7 +116,7 @@ impl MessageBridge for WithRialtoMessageBridge { #[derive(RuntimeDebug, Clone, Copy)] pub struct Millau; -impl messages::ChainWithMessages for Millau { +impl messages::UnderlyingChainProvider for Millau { type Chain = bp_millau::Millau; } @@ -174,7 +174,7 @@ impl messages::ThisChainWithMessages for Millau { #[derive(RuntimeDebug, Clone, Copy)] pub struct Rialto; -impl messages::ChainWithMessages for Rialto { +impl messages::UnderlyingChainProvider for Rialto { type Chain = bp_rialto::Rialto; } diff --git a/bridges/bin/millau/runtime/src/rialto_parachain_messages.rs b/bridges/bin/millau/runtime/src/rialto_parachain_messages.rs index 70e8db89d3..da4ca9d83c 100644 --- a/bridges/bin/millau/runtime/src/rialto_parachain_messages.rs +++ b/bridges/bin/millau/runtime/src/rialto_parachain_messages.rs @@ -123,7 +123,7 @@ impl MessageBridge for WithRialtoParachainMessageBridge { #[derive(RuntimeDebug, Clone, Copy)] pub struct Millau; -impl messages::ChainWithMessages for Millau { +impl messages::UnderlyingChainProvider for Millau { type Chain = bp_millau::Millau; } @@ -165,7 +165,7 @@ impl messages::ThisChainWithMessages for Millau { #[derive(RuntimeDebug, Clone, Copy)] pub struct RialtoParachain; -impl messages::ChainWithMessages for RialtoParachain { +impl messages::UnderlyingChainProvider for RialtoParachain { type Chain = bp_rialto_parachain::RialtoParachain; } diff --git a/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs b/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs index a13a17a1ea..60bc038339 100644 --- a/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs +++ b/bridges/bin/rialto-parachain/runtime/src/millau_messages.rs @@ -120,7 +120,7 @@ impl MessageBridge for WithMillauMessageBridge { #[derive(RuntimeDebug, Clone, Copy)] pub struct RialtoParachain; -impl messages::ChainWithMessages for RialtoParachain { +impl messages::UnderlyingChainProvider for RialtoParachain { type Chain = bp_rialto_parachain::RialtoParachain; } @@ -181,7 +181,7 @@ impl messages::ThisChainWithMessages for RialtoParachain { #[derive(RuntimeDebug, Clone, Copy)] pub struct Millau; -impl messages::ChainWithMessages for Millau { +impl messages::UnderlyingChainProvider for Millau { type Chain = bp_millau::Millau; } diff --git a/bridges/bin/rialto/runtime/src/millau_messages.rs b/bridges/bin/rialto/runtime/src/millau_messages.rs index b27cce4007..cf8812eaf9 100644 --- a/bridges/bin/rialto/runtime/src/millau_messages.rs +++ b/bridges/bin/rialto/runtime/src/millau_messages.rs @@ -114,7 +114,7 @@ impl MessageBridge for WithMillauMessageBridge { #[derive(RuntimeDebug, Clone, Copy)] pub struct Rialto; -impl messages::ChainWithMessages for Rialto { +impl messages::UnderlyingChainProvider for Rialto { type Chain = bp_rialto::Rialto; } @@ -172,7 +172,7 @@ impl messages::ThisChainWithMessages for Rialto { #[derive(RuntimeDebug, Clone, Copy)] pub struct Millau; -impl messages::ChainWithMessages for Millau { +impl messages::UnderlyingChainProvider for Millau { type Chain = bp_millau::Millau; } diff --git a/bridges/bin/runtime-common/src/messages.rs b/bridges/bin/runtime-common/src/messages.rs index 75c3ec6e57..320b91539b 100644 --- a/bridges/bin/runtime-common/src/messages.rs +++ b/bridges/bin/runtime-common/src/messages.rs @@ -58,7 +58,7 @@ pub trait MessageBridge { /// Bridged chain in context of message bridge. type BridgedChain: BridgedChainWithMessages; /// Bridged header chain. - type BridgedHeaderChain: HeaderChain<::Chain>; + type BridgedHeaderChain: HeaderChain>; /// Convert Bridged chain balance into This chain balance. fn bridged_balance_to_this_balance( @@ -115,14 +115,14 @@ impl< } } -/// Chain that has `pallet-bridge-messages` module. -pub trait ChainWithMessages { +/// A trait that provides the type of the underlying chain. +pub trait UnderlyingChainProvider { /// Underlying chain type. type Chain: Chain; } /// This chain that has `pallet-bridge-messages` module. -pub trait ThisChainWithMessages: ChainWithMessages { +pub trait ThisChainWithMessages: UnderlyingChainProvider { /// Call origin on the chain. type RuntimeOrigin; /// Call type on the chain. @@ -149,7 +149,7 @@ pub trait ThisChainWithMessages: ChainWithMessages { } /// Bridged chain that has `pallet-bridge-messages` module. -pub trait BridgedChainWithMessages: ChainWithMessages { +pub trait BridgedChainWithMessages: UnderlyingChainProvider { /// Returns `true` if message dispatch weight is withing expected limits. `false` means /// that the message is too heavy to be sent over the bridge and shall be rejected. fn verify_dispatch_weight(message_payload: &[u8]) -> bool; @@ -171,15 +171,15 @@ pub type ThisChain = ::ThisChain; /// Bridged chain in context of message bridge. pub type BridgedChain = ::BridgedChain; /// Underlying chain type. -pub type UnderlyingChainOf = ::Chain; +pub type UnderlyingChainOf = ::Chain; /// Hash used on the chain. -pub type HashOf = bp_runtime::HashOf<::Chain>; +pub type HashOf = bp_runtime::HashOf<::Chain>; /// Hasher used on the chain. -pub type HasherOf = bp_runtime::HasherOf<::Chain>; +pub type HasherOf = bp_runtime::HasherOf>; /// Account id used on the chain. -pub type AccountIdOf = bp_runtime::AccountIdOf<::Chain>; +pub type AccountIdOf = bp_runtime::AccountIdOf>; /// Type of balances that is used on the chain. -pub type BalanceOf = bp_runtime::BalanceOf<::Chain>; +pub type BalanceOf = bp_runtime::BalanceOf>; /// Type of origin that is used on the chain. pub type OriginOf = ::RuntimeOrigin; /// Type of call that is used on this chain. @@ -996,7 +996,7 @@ mod tests { struct ThisChain; - impl ChainWithMessages for ThisChain { + impl UnderlyingChainProvider for ThisChain { type Chain = ThisUnderlyingChain; } @@ -1071,7 +1071,7 @@ mod tests { struct BridgedChain; - impl ChainWithMessages for BridgedChain { + impl UnderlyingChainProvider for BridgedChain { type Chain = BridgedUnderlyingChain; }