Struct pallet_babe::EquivocationHandler [−][src]
pub struct EquivocationHandler<I, R, L> { /* fields omitted */ }
Expand description
Generic equivocation handler. This type implements HandleEquivocation
using existing subsystems that are part of frame (type bounds described
below) and will dispatch to them directly, it’s only purpose is to wire all
subsystems together.
Trait Implementations
impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<T::KeyOwnerIdentification, R, L> where
T: Config + Config + SendTransactionTypes<Call<T>>,
R: ReportOffence<T::AccountId, T::KeyOwnerIdentification, BabeEquivocationOffence<T::KeyOwnerIdentification>>,
L: Get<u64>,
impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<T::KeyOwnerIdentification, R, L> where
T: Config + Config + SendTransactionTypes<Call<T>>,
R: ReportOffence<T::AccountId, T::KeyOwnerIdentification, BabeEquivocationOffence<T::KeyOwnerIdentification>>,
L: Get<u64>,
type ReportLongevity = L
type ReportLongevity = L
The longevity, in blocks, that the equivocation report is valid for. When using the staking pallet this should be equal to the bonding duration (in blocks, not eras). Read more
fn report_offence(
reporters: Vec<T::AccountId>,
offence: BabeEquivocationOffence<T::KeyOwnerIdentification>
) -> Result<(), OffenceError>
fn report_offence(
reporters: Vec<T::AccountId>,
offence: BabeEquivocationOffence<T::KeyOwnerIdentification>
) -> Result<(), OffenceError>
Report an offence proved by the given reporters.
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
fn submit_unsigned_equivocation_report(
equivocation_proof: EquivocationProof<T::Header>,
key_owner_proof: T::KeyOwnerProof
) -> DispatchResult
Create and dispatch an equivocation report extrinsic.
Fetch the current block author id, if defined.
Auto Trait Implementations
impl<I, R, L> RefUnwindSafe for EquivocationHandler<I, R, L> where
I: RefUnwindSafe,
L: RefUnwindSafe,
R: RefUnwindSafe,
impl<I, R, L> Send for EquivocationHandler<I, R, L> where
I: Send,
L: Send,
R: Send,
impl<I, R, L> Sync for EquivocationHandler<I, R, L> where
I: Sync,
L: Sync,
R: Sync,
impl<I, R, L> Unpin for EquivocationHandler<I, R, L> where
I: Unpin,
L: Unpin,
R: Unpin,
impl<I, R, L> UnwindSafe for EquivocationHandler<I, R, L> where
I: UnwindSafe,
L: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V