pub trait HandleReports<T: Config> {
    type ReportLongevity: Get<u64>;

    // Required methods
    fn report_offence(
        offence: SlashingOffence<T::KeyOwnerIdentification>
    ) -> Result<(), OffenceError>;
    fn is_known_offence(
        offenders: &[T::KeyOwnerIdentification],
        time_slot: &DisputesTimeSlot
    ) -> bool;
    fn submit_unsigned_slashing_report(
        dispute_proof: DisputeProof,
        key_owner_proof: T::KeyOwnerProof
    ) -> Result<(), TryRuntimeError>;
}
Expand description

A trait that defines methods to report an offence (after the slashing report has been validated) and for submitting a transaction to report a slash (from an offchain context).

Required Associated Types§

source

type ReportLongevity: Get<u64>

The longevity, in blocks, that the offence report is valid for. When using the staking pallet this should be equal to the bonding duration (in blocks, not eras).

Required Methods§

source

fn report_offence( offence: SlashingOffence<T::KeyOwnerIdentification> ) -> Result<(), OffenceError>

Report an offence.

source

fn is_known_offence( offenders: &[T::KeyOwnerIdentification], time_slot: &DisputesTimeSlot ) -> bool

Returns true if the offenders at the given time slot has already been reported.

source

fn submit_unsigned_slashing_report( dispute_proof: DisputeProof, key_owner_proof: T::KeyOwnerProof ) -> Result<(), TryRuntimeError>

Create and dispatch a slashing report extrinsic. This should be called offchain.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: Config> HandleReports<T> for ()

§

type ReportLongevity = ()

source§

fn report_offence( _offence: SlashingOffence<T::KeyOwnerIdentification> ) -> Result<(), OffenceError>

source§

fn is_known_offence( _offenders: &[T::KeyOwnerIdentification], _time_slot: &DisputesTimeSlot ) -> bool

source§

fn submit_unsigned_slashing_report( _dispute_proof: DisputeProof, _key_owner_proof: T::KeyOwnerProof ) -> Result<(), TryRuntimeError>

Implementors§

source§

impl<T, R, L> HandleReports<T> for SlashingReportHandler<T::KeyOwnerIdentification, R, L>
where T: Config + SendTransactionTypes<Call<T>>, R: ReportOffence<T::AccountId, T::KeyOwnerIdentification, SlashingOffence<T::KeyOwnerIdentification>>, L: Get<u64>,