only store header state root (pallet-bridge-grandpa) (#1699)

This commit is contained in:
Svyatoslav Nikolsky
2022-12-05 14:03:23 +03:00
committed by Bastian Köcher
parent b94bd8d46b
commit 7014046485
16 changed files with 113 additions and 193 deletions
+25 -1
View File
@@ -96,10 +96,34 @@ pub const ROOT_ACCOUNT_DERIVATION_PREFIX: &[u8] = b"pallet-bridge/account-deriva
/// Generic header Id.
#[derive(
RuntimeDebug, Default, Clone, Encode, Decode, Copy, Eq, Hash, PartialEq, PartialOrd, Ord,
RuntimeDebug,
Default,
Clone,
Encode,
Decode,
Copy,
Eq,
Hash,
MaxEncodedLen,
PartialEq,
PartialOrd,
Ord,
TypeInfo,
)]
pub struct HeaderId<Hash, Number>(pub Number, pub Hash);
impl<Hash: Copy, Number: Copy> HeaderId<Hash, Number> {
/// Return header number.
pub fn number(&self) -> Number {
self.0
}
/// Return header hash.
pub fn hash(&self) -> Hash {
self.1
}
}
/// Generic header id provider.
pub trait HeaderIdProvider<Header: HeaderT> {
// Get the header id.