jam-std-common 0.1.28

Common datatypes and utilities for the JAM nodes and tooling
Documentation
use codec::{Decode, Encode, MaxEncodedLen};
use jam_types::{HeaderHash, Slot};

/// Identifier of a GRANDPA set of authorities. Although it is similar to EpochIndex it is not
/// the same. GrandpaSetId starts at 0 at genesis and increments for every set change. This will
/// normally happen at epoch changes but is not quaranteed to. EpochIndex is a function of time
/// since JAM common era, hence they might be skipped (eg, after genesis or if the network is down)
/// but GRANDPA sets are never skipped. They are always incremental from the previous set.
pub type GrandpaSetId = u32;

/// The round indicator.
pub type GrandpaRoundNumber = u64;

#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, MaxEncodedLen)]
pub enum GrandpaMessage {
	#[codec(index = 0)]
	Prevote(HeaderHash, Slot),
	#[codec(index = 1)]
	Precommit(HeaderHash, Slot),
	#[codec(index = 2)]
	PrimaryPropose(HeaderHash, Slot),
}