GRANDPA module: store accepted justifications (#2298) (#2301)

Store accepted justifications in events.
This commit is contained in:
Serban Iorga
2023-07-27 15:50:17 +03:00
committed by Bastian Köcher
parent 5f73a456c5
commit 7807b9de93
27 changed files with 193 additions and 63 deletions
+15 -1
View File
@@ -21,7 +21,7 @@
use bp_runtime::{
BasicOperatingMode, Chain, HashOf, HasherOf, HeaderOf, RawStorageProof, StorageProofChecker,
StorageProofError,
StorageProofError, UnderlyingChainProvider,
};
use codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen};
use core::{clone::Clone, cmp::Eq, default::Default, fmt::Debug};
@@ -234,3 +234,17 @@ pub trait ChainWithGrandpa: Chain {
/// refund amount and doing calls which exceed the limit, may be costly to submitter.
const AVERAGE_HEADER_SIZE_IN_JUSTIFICATION: u32;
}
/// A trait that provides the type of the underlying `ChainWithGrandpa`.
pub trait UnderlyingChainWithGrandpaProvider: UnderlyingChainProvider {
/// Underlying `ChainWithGrandpa` type.
type ChainWithGrandpa: ChainWithGrandpa;
}
impl<T> UnderlyingChainWithGrandpaProvider for T
where
T: UnderlyingChainProvider,
T::Chain: ChainWithGrandpa,
{
type ChainWithGrandpa = T::Chain;
}