Expand description

The #[pallet::genesis_build] attribute allows you to define how genesis_configuration is built. This takes as input the GenesisConfig type (as self) and constructs the pallet’s initial state.

The impl must be defined as:

impl<T: Config> GenesisBuild<T> for GenesisConfig<$maybe_generics> {
	fn build(&self) { $expr }

I.e. a trait implementation with generic T: Config, of trait GenesisBuild<T> on type GenesisConfig with generics none or T.


impl<T: Config> GenesisBuild<T> for GenesisConfig {
	fn build(&self) {}

Macro expansion

The macro will add the following attribute:

  • #[cfg(feature = "std")]

The macro will implement sp_runtime::BuildStorage.