referrerpolicy=no-referrer-when-downgrade

OnEraStart

Trait OnEraStart 

Source
pub trait OnEraStart<AccountId> {
    // Required methods
    fn on_era_start(era: EraIndex, validators: &[AccountId]);
    fn weight(validators: u32) -> Weight;

    // Provided method
    fn enabled() -> bool { ... }
}
Expand description

Notified when a new era becomes active.

Required Methods§

Source

fn on_era_start(era: EraIndex, validators: &[AccountId])

Called once when era becomes active, with the validators elected for it.

Source

fn weight(validators: u32) -> Weight

Upper bound of the weight of Self::on_era_start for validators validators.

Provided Methods§

Source

fn enabled() -> bool

Whether the hook is in use. When false, staking does not keep the elected set, and at era start it only removes a copy kept while the hook was enabled, charged as one read and one write.

Expected to be constant for a given runtime version.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<AccountId> OnEraStart<AccountId> for ()

Source§

fn enabled() -> bool

Source§

fn on_era_start(_era: EraIndex, _validators: &[AccountId])

Source§

fn weight(_validators: u32) -> Weight

Implementors§