Trait sp_consensus_subspace::offence::Offence
source · pub trait Offence<Offender> {
type TimeSlot: Clone + Codec + Ord;
const ID: Kind;
// Required methods
fn offenders(&self) -> Vec<Offender>;
fn time_slot(&self) -> Self::TimeSlot;
}
Expand description
A trait implemented by an offence report.
This trait assumes that the offence is legitimate and was validated already.
Examples of offences include: a BABE equivocation or a GRANDPA unjustified vote.
Required Associated Types§
Required Associated Constants§
Required Methods§
sourcefn offenders(&self) -> Vec<Offender>
fn offenders(&self) -> Vec<Offender>
The list of all offenders involved in this incident.
The list has no duplicates, so it is rather a set.
sourcefn time_slot(&self) -> Self::TimeSlot
fn time_slot(&self) -> Self::TimeSlot
A point in time when this offence happened.
This is used for looking up offences that happened at the “same time”.
The timescale is abstract and doesn’t have to be the same across different implementations
of this trait. The value doesn’t represent absolute timescale though since it is interpreted
along with the session_index
. Two offences are considered to happen at the same time if
time_slot
is the same.
Object Safety§
This trait is not object safe.