Trait sp_staking::OnStakingUpdate

source ·
pub trait OnStakingUpdate<AccountId, Balance> {
    // Provided methods
    fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>) { ... }
    fn on_nominator_add(_who: &AccountId) { ... }
    fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>) { ... }
    fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>) { ... }
    fn on_validator_add(_who: &AccountId) { ... }
    fn on_validator_update(_who: &AccountId) { ... }
    fn on_validator_remove(_who: &AccountId) { ... }
    fn on_unstake(_who: &AccountId) { ... }
    fn on_slash(
        _stash: &AccountId,
        _slashed_active: Balance,
        _slashed_unlocking: &BTreeMap<EraIndex, Balance>,
        _slashed_total: Balance,
    ) { ... }
    fn on_withdraw(_stash: &AccountId, _amount: Balance) { ... }
}
Expand description

A generic staking event listener.

Note that the interface is designed in a way that the events are fired post-action, so any pre-action data that is needed needs to be passed to interface methods. The rest of the data can be retrieved by using StakingInterface.

Provided Methods§

source

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<AccountId, Balance> OnStakingUpdate<AccountId, Balance> for ()
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0,)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>, TupleElement1: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0, TupleElement1)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>, TupleElement1: OnStakingUpdate<AccountId, Balance>, TupleElement2: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>, TupleElement1: OnStakingUpdate<AccountId, Balance>, TupleElement2: OnStakingUpdate<AccountId, Balance>, TupleElement3: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>, TupleElement1: OnStakingUpdate<AccountId, Balance>, TupleElement2: OnStakingUpdate<AccountId, Balance>, TupleElement3: OnStakingUpdate<AccountId, Balance>, TupleElement4: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>, TupleElement1: OnStakingUpdate<AccountId, Balance>, TupleElement2: OnStakingUpdate<AccountId, Balance>, TupleElement3: OnStakingUpdate<AccountId, Balance>, TupleElement4: OnStakingUpdate<AccountId, Balance>, TupleElement5: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>, TupleElement1: OnStakingUpdate<AccountId, Balance>, TupleElement2: OnStakingUpdate<AccountId, Balance>, TupleElement3: OnStakingUpdate<AccountId, Balance>, TupleElement4: OnStakingUpdate<AccountId, Balance>, TupleElement5: OnStakingUpdate<AccountId, Balance>, TupleElement6: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>, TupleElement1: OnStakingUpdate<AccountId, Balance>, TupleElement2: OnStakingUpdate<AccountId, Balance>, TupleElement3: OnStakingUpdate<AccountId, Balance>, TupleElement4: OnStakingUpdate<AccountId, Balance>, TupleElement5: OnStakingUpdate<AccountId, Balance>, TupleElement6: OnStakingUpdate<AccountId, Balance>, TupleElement7: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>, TupleElement1: OnStakingUpdate<AccountId, Balance>, TupleElement2: OnStakingUpdate<AccountId, Balance>, TupleElement3: OnStakingUpdate<AccountId, Balance>, TupleElement4: OnStakingUpdate<AccountId, Balance>, TupleElement5: OnStakingUpdate<AccountId, Balance>, TupleElement6: OnStakingUpdate<AccountId, Balance>, TupleElement7: OnStakingUpdate<AccountId, Balance>, TupleElement8: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

source§

impl<AccountId, Balance, TupleElement0: OnStakingUpdate<AccountId, Balance>, TupleElement1: OnStakingUpdate<AccountId, Balance>, TupleElement2: OnStakingUpdate<AccountId, Balance>, TupleElement3: OnStakingUpdate<AccountId, Balance>, TupleElement4: OnStakingUpdate<AccountId, Balance>, TupleElement5: OnStakingUpdate<AccountId, Balance>, TupleElement6: OnStakingUpdate<AccountId, Balance>, TupleElement7: OnStakingUpdate<AccountId, Balance>, TupleElement8: OnStakingUpdate<AccountId, Balance>, TupleElement9: OnStakingUpdate<AccountId, Balance>> OnStakingUpdate<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7, TupleElement8, TupleElement9)
where Option<Stake<Balance>>: Clone, Vec<AccountId>: Clone, Balance: Clone,

source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates.

This is effectively any changes to the bond amount, such as bonding more funds, and unbonding.

source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate.

This should never be fired for existing nominators.

source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations.

Note that this is not fired when a nominator changes their stake. For that, on_stake_update should be used, followed by querying whether who was a validator or a nominator.

source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating.

The set of nominations at the time of removal is provided as it can no longer be fetched in any way.

source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences.

Note validator preference changes are not communicated, but could be added if needed.

source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.

source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.

source§

fn on_slash( _stash: &AccountId, _slashed_active: Balance, _slashed_unlocking: &BTreeMap<EraIndex, Balance>, _slashed_total: Balance, )

Fired when a staker is slashed.

  • 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.
  • slashed_total - The aggregated balance that was lost due to the slash.
source§

fn on_withdraw(_stash: &AccountId, _amount: Balance)

Fired when a portion of a staker’s balance has been withdrawn.

Implementors§