referrerpolicy=no-referrer-when-downgrade

Trait sp_staking::offence::ReportOffence

source ·
pub trait ReportOffence<Reporter, Offender, O: Offence<Offender>> {
    // Required methods
    fn report_offence(
        reporters: Vec<Reporter>,
        offence: O,
    ) -> Result<(), OffenceError>;
    fn is_known_offence(offenders: &[Offender], time_slot: &O::TimeSlot) -> bool;
}
Expand description

A trait for decoupling offence reporters from the actual handling of offence reports.

Required Methods§

source

fn report_offence( reporters: Vec<Reporter>, offence: O, ) -> Result<(), OffenceError>

Report an offence and reward given reporters.

source

fn is_known_offence(offenders: &[Offender], time_slot: &O::TimeSlot) -> bool

Returns true iff all of the given offenders have been previously reported at the given time slot. This function is useful to prevent the sending of duplicate offence reports.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<Reporter, Offender, O: Offence<Offender>> ReportOffence<Reporter, Offender, O> for ()

source§

fn report_offence( _reporters: Vec<Reporter>, _offence: O, ) -> Result<(), OffenceError>

source§

fn is_known_offence(_offenders: &[Offender], _time_slot: &O::TimeSlot) -> bool

Implementors§