ChainWithGrandpa in primitives (#1885)

* ChainWithGrandpa in primitives

* clippy ++ spelling

* fix benchmarks comppilation
This commit is contained in:
Svyatoslav Nikolsky
2023-02-16 15:20:45 +03:00
committed by Bastian Köcher
parent 914213d0af
commit c6c39be967
33 changed files with 421 additions and 139 deletions
+14 -5
View File
@@ -73,11 +73,6 @@ pub trait RelayChain: Chain {
const PARACHAINS_FINALITY_PALLET_NAME: &'static str;
}
/// Substrate-based parachain from minimal relay-client point of view.
pub trait Parachain: Chain + ParachainBase {}
impl<T> Parachain for T where T: UnderlyingChainProvider + Chain + ParachainBase {}
/// Substrate-based chain that is using direct GRANDPA finality from minimal relay-client point of
/// view.
///
@@ -92,6 +87,20 @@ pub trait ChainWithGrandpa: Chain {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str;
}
impl<T> ChainWithGrandpa for T
where
T: Chain + UnderlyingChainProvider,
T::Chain: bp_header_chain::ChainWithGrandpa,
{
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str =
<T::Chain as bp_header_chain::ChainWithGrandpa>::WITH_CHAIN_GRANDPA_PALLET_NAME;
}
/// Substrate-based parachain from minimal relay-client point of view.
pub trait Parachain: Chain + ParachainBase {}
impl<T> Parachain for T where T: UnderlyingChainProvider + Chain + ParachainBase {}
/// Substrate-based chain with messaging support from minimal relay-client point of view.
pub trait ChainWithMessages: Chain {
/// Name of the bridge messages pallet (used in `construct_runtime` macro call) that is deployed