[][src]Trait pallet_grandpa::HandleEquivocation

pub trait HandleEquivocation<T: Trait> {
    type Offence: GrandpaOffence<T::KeyOwnerIdentification>;
    pub fn report_offence(
        reporters: Vec<T::AccountId>,
        offence: Self::Offence
    ) -> Result<(), OffenceError>;
pub fn is_known_offence(
        offenders: &[T::KeyOwnerIdentification],
        time_slot: &<Self::Offence as Offence<T::KeyOwnerIdentification>>::TimeSlot
    ) -> bool;
pub fn submit_unsigned_equivocation_report(
        equivocation_proof: EquivocationProof<T::Hash, T::BlockNumber>,
        key_owner_proof: T::KeyOwnerProof
    ) -> DispatchResult;
pub fn block_author() -> Option<T::AccountId>; }

A trait with utility methods for handling equivocation reports in GRANDPA. The offence type is generic, and the trait provides , reporting an offence triggered by a valid equivocation report, and also for creating and submitting equivocation report extrinsics (useful only in offchain context).

Associated Types

type Offence: GrandpaOffence<T::KeyOwnerIdentification>[src]

The offence type used for reporting offences on valid equivocation reports.

Loading content...

Required methods

pub fn report_offence(
    reporters: Vec<T::AccountId>,
    offence: Self::Offence
) -> Result<(), OffenceError>
[src]

Report an offence proved by the given reporters.

pub fn is_known_offence(
    offenders: &[T::KeyOwnerIdentification],
    time_slot: &<Self::Offence as Offence<T::KeyOwnerIdentification>>::TimeSlot
) -> bool
[src]

Returns true if all of the offenders at the given time slot have already been reported.

pub fn submit_unsigned_equivocation_report(
    equivocation_proof: EquivocationProof<T::Hash, T::BlockNumber>,
    key_owner_proof: T::KeyOwnerProof
) -> DispatchResult
[src]

Create and dispatch an equivocation report extrinsic.

pub fn block_author() -> Option<T::AccountId>[src]

Fetch the current block author id, if defined.

Loading content...

Implementations on Foreign Types

impl<T: Trait> HandleEquivocation<T> for ()[src]

type Offence = GrandpaEquivocationOffence<T::KeyOwnerIdentification>

Loading content...

Implementors

impl<T, R, O> HandleEquivocation<T> for EquivocationHandler<T::KeyOwnerIdentification, R, O> where
    T: Trait + Trait + SendTransactionTypes<Call<T>>,
    R: ReportOffence<T::AccountId, T::KeyOwnerIdentification, O>,
    O: GrandpaOffence<T::KeyOwnerIdentification>, 
[src]

type Offence = O

Loading content...