Attribute Macro frame_support::pallet_macros::extra_constants

source ยท
#[extra_constants]
Expand description

Defines constants that are added to the constant field of PalletMetadata struct for this pallet.

Must be defined like:

#[frame_support::pallet]
mod pallet {
	#[pallet::pallet]
	pub struct Pallet<T>(_);

	#[pallet::extra_constants]
	impl<T: Config> Pallet<T> // $optional_where_clause
	{
	#[pallet::constant_name(SomeU32ConstantName)]
		/// Some doc
		fn some_u32_constant() -> u32 {
			100u32
		}
	}
}

I.e. a regular rust impl block with some optional where clause and functions with 0 args, 0 generics, and some return type.


Documentation for this macro can be found at frame_support::pallet_macros::extra_constants.