Trait sp_staking::OnStakerSlash
source · pub trait OnStakerSlash<AccountId, Balance> {
fn on_slash(
stash: &AccountId,
slashed_active: Balance,
slashed_unlocking: &BTreeMap<EraIndex, Balance>
);
}Expand description
Trait describing something that implements a hook for any operations to perform when a staker is slashed.
Required Methods§
sourcefn on_slash(
stash: &AccountId,
slashed_active: Balance,
slashed_unlocking: &BTreeMap<EraIndex, Balance>
)
fn on_slash(
stash: &AccountId,
slashed_active: Balance,
slashed_unlocking: &BTreeMap<EraIndex, Balance>
)
A hook for any operations to perform when a staker is slashed.
Arguments
stash- The stash of the staker whom the slash was applied to.slashed_active- The new bonded balance of the staker after the slash was applied.slashed_unlocking- A map of slashed eras, and the balance of that unlocking chunk after the slash is applied. Any era not present in the map is not affected at all.