jam_std_common/finality.rs
1use codec::{Decode, Encode, MaxEncodedLen};
2use jam_types::{HeaderHash, Slot};
3
4/// Identifier of a GRANDPA set of authorities. Although it is similar to EpochIndex it is not
5/// the same. GrandpaSetId starts at 0 at genesis and increments for every set change. This will
6/// normally happen at epoch changes but is not quaranteed to. EpochIndex is a function of time
7/// since JAM common era, hence they might be skipped (eg, after genesis or if the network is down)
8/// but GRANDPA sets are never skipped. They are always incremental from the previous set.
9pub type GrandpaSetId = u32;
10
11/// The round indicator.
12pub type GrandpaRoundNumber = u64;
13
14#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen)]
15pub enum GrandpaMessage {
16 #[codec(index = 0)]
17 Prevote(HeaderHash, Slot),
18 #[codec(index = 1)]
19 Precommit(HeaderHash, Slot),
20 #[codec(index = 2)]
21 PrimaryPropose(HeaderHash, Slot),
22}