Attribute Macro frame_support::pallet_macros::event

source ·
#[event]
Expand description

The #[pallet::event] attribute allows you to define pallet events. Pallet events are stored under the system / events key when the block is applied (and then replaced when the next block writes it’s events).

The Event enum must be defined as follows:

#[pallet::event]
#[pallet::generate_deposit($visibility fn deposit_event)] // Optional
pub enum Event<$some_generic> $optional_where_clause {
	/// Some doc
	$SomeName($SomeType, $YetanotherType, ...),
	...
}

I.e. an enum (with named or unnamed fields variant), named Event, with generic: none or T or T: Config, and optional w here clause.

Each field must implement [Clone], [Eq], [PartialEq], Encode, Decode, and [Debug] (on std only). For ease of use, bound by the trait Member, available in frame_support::pallet_prelude.