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§
sourcetype ReportLongevity: Get<u64>
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§
sourcefn report_offence(
offence: SlashingOffence<T::KeyOwnerIdentification>,
) -> Result<(), OffenceError>
fn report_offence( offence: SlashingOffence<T::KeyOwnerIdentification>, ) -> Result<(), OffenceError>
Report an offence.
sourcefn is_known_offence(
offenders: &[T::KeyOwnerIdentification],
time_slot: &DisputesTimeSlot,
) -> bool
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.
sourcefn submit_unsigned_slashing_report(
dispute_proof: DisputeProof,
key_owner_proof: T::KeyOwnerProof,
) -> Result<(), TryRuntimeError>
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.