Trait sp_staking::offence::ReportOffence [−][src]
pub trait ReportOffence<Reporter, Offender, O: Offence<Offender>> { 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
fn report_offence(
reporters: Vec<Reporter>,
offence: O
) -> Result<(), OffenceError>
fn report_offence(
reporters: Vec<Reporter>,
offence: O
) -> Result<(), OffenceError>
Report an offence
and reward given reporters
.
fn is_known_offence(offenders: &[Offender], time_slot: &O::TimeSlot) -> bool
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.
Implementations on Foreign Types
Implementors
impl<T: Config, O: Offence<T::IdentificationTuple>> ReportOffence<<T as Config>::AccountId, <T as Config>::IdentificationTuple, O> for Pallet<T> where
T::IdentificationTuple: Clone,
impl<T: Config, O: Offence<T::IdentificationTuple>> ReportOffence<<T as Config>::AccountId, <T as Config>::IdentificationTuple, O> for Pallet<T> where
T::IdentificationTuple: Clone,
impl<T, Reporter, Offender, R, O> ReportOffence<Reporter, Offender, O> for FilterHistoricalOffences<Pallet<T>, R> where
T: Config,
R: ReportOffence<Reporter, Offender, O>,
O: Offence<Offender>,
impl<T, Reporter, Offender, R, O> ReportOffence<Reporter, Offender, O> for FilterHistoricalOffences<Pallet<T>, R> where
T: Config,
R: ReportOffence<Reporter, Offender, O>,
O: Offence<Offender>,