[−][src]Trait pallet_babe::HandleEquivocation
A trait with utility methods for handling equivocation reports in BABE. The trait provides methods for reporting an offence triggered by a valid equivocation report, checking the current block author (to declare as the reporter), and also for creating and submitting equivocation report extrinsics (useful only in offchain context).
Required methods
fn report_offence(
reporters: Vec<T::AccountId>,
offence: BabeEquivocationOffence<T::KeyOwnerIdentification>
) -> Result<(), OffenceError>
reporters: Vec<T::AccountId>,
offence: BabeEquivocationOffence<T::KeyOwnerIdentification>
) -> Result<(), OffenceError>
Report an offence proved by the given reporters.
fn is_known_offence(
offenders: &[T::KeyOwnerIdentification],
time_slot: &SlotNumber
) -> bool
offenders: &[T::KeyOwnerIdentification],
time_slot: &SlotNumber
) -> bool
Returns true if all of the offenders at the given time slot have already been reported.
fn submit_unsigned_equivocation_report(
equivocation_proof: EquivocationProof<T::Header>,
key_owner_proof: T::KeyOwnerProof
) -> DispatchResult
equivocation_proof: EquivocationProof<T::Header>,
key_owner_proof: T::KeyOwnerProof
) -> DispatchResult
Create and dispatch an equivocation report extrinsic.
fn block_author() -> Option<T::AccountId>
Fetch the current block author id, if defined.
Implementations on Foreign Types
impl<T: Trait> HandleEquivocation<T> for ()
[src]
fn report_offence(
_reporters: Vec<T::AccountId>,
_offence: BabeEquivocationOffence<T::KeyOwnerIdentification>
) -> Result<(), OffenceError>
[src]
_reporters: Vec<T::AccountId>,
_offence: BabeEquivocationOffence<T::KeyOwnerIdentification>
) -> Result<(), OffenceError>
fn is_known_offence(
_offenders: &[T::KeyOwnerIdentification],
_time_slot: &SlotNumber
) -> bool
[src]
_offenders: &[T::KeyOwnerIdentification],
_time_slot: &SlotNumber
) -> bool
fn submit_unsigned_equivocation_report(
_equivocation_proof: EquivocationProof<T::Header>,
_key_owner_proof: T::KeyOwnerProof
) -> DispatchResult
[src]
_equivocation_proof: EquivocationProof<T::Header>,
_key_owner_proof: T::KeyOwnerProof
) -> DispatchResult
fn block_author() -> Option<T::AccountId>
[src]
Implementors
impl<T, R> HandleEquivocation<T> for EquivocationHandler<T::KeyOwnerIdentification, R> where
T: Trait + Trait + SendTransactionTypes<Call<T>>,
R: ReportOffence<T::AccountId, T::KeyOwnerIdentification, BabeEquivocationOffence<T::KeyOwnerIdentification>>,
[src]
T: Trait + Trait + SendTransactionTypes<Call<T>>,
R: ReportOffence<T::AccountId, T::KeyOwnerIdentification, BabeEquivocationOffence<T::KeyOwnerIdentification>>,
fn report_offence(
reporters: Vec<T::AccountId>,
offence: BabeEquivocationOffence<T::KeyOwnerIdentification>
) -> Result<(), OffenceError>
[src]
reporters: Vec<T::AccountId>,
offence: BabeEquivocationOffence<T::KeyOwnerIdentification>
) -> Result<(), OffenceError>
fn is_known_offence(
offenders: &[T::KeyOwnerIdentification],
time_slot: &SlotNumber
) -> bool
[src]
offenders: &[T::KeyOwnerIdentification],
time_slot: &SlotNumber
) -> bool
fn submit_unsigned_equivocation_report(
equivocation_proof: EquivocationProof<T::Header>,
key_owner_proof: T::KeyOwnerProof
) -> DispatchResult
[src]
equivocation_proof: EquivocationProof<T::Header>,
key_owner_proof: T::KeyOwnerProof
) -> DispatchResult