Attribute Macro frame_support_procedural::inherent

source ·
#[inherent]
Expand description

The #[pallet::inherent] attribute allows the pallet to provide some inherent. An inherent is some piece of data that is inserted by a block authoring node at block creation time and can either be accepted or rejected by validators based on whether the data falls within an acceptable range.

The most common inherent is the timestamp that is inserted into every block. Since there is no way to validate timestamps, validators simply check that the timestamp reported by the block authoring node falls within an acceptable range.

Item must be defined as:

#[pallet::inherent]
impl<T: Config> ProvideInherent for Pallet<T> {
	// ... regular trait implementation
}

I.e. a trait implementation with bound T: Config, of trait ProvideInherent for type Pallet<T>, and some optional where clause.

Macro expansion

The macro currently makes no use of this information, but it might use this information in the future to give information directly to construct_runtime.