Config

Trait Config 

Source
pub trait Config: Config {
    type OnNewEpoch: OnNewEpoch;

    // Required method
    fn reference_timestamp_millis() -> u64;
}
Expand description

Configuration trait of this pallet.

The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.

Consequently, a runtime that wants to include this pallet must implement this trait.

Required Associated Types§

Source

type OnNewEpoch: OnNewEpoch

Handler that is called at initialization of the first block of a new Partner Chain epoch

Required Methods§

Source

fn reference_timestamp_millis() -> u64

Should return the reference timestamp of the current block in milliseconds

The reference timestamp does not necessarily have to be the exact timestamp of the block but must be one close enough for the purpose of epoch calculation, eg. the slot starting time in case of chains using a slot-based consensus such as Aura or Babe.

Warning: this function must be safe to call during block initialisation, which means that in particular block timestamp stored in pallet_timestamp can not be used.

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.

Implementors§