Attribute Macro frame_support::pallet_macros::validate_unsigned

source ·
#[validate_unsigned]
Expand description

Allows the pallet to validate unsigned transactions.

Item must be defined as:

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

	#[pallet::validate_unsigned]
	impl<T: Config> sp_runtime::traits::ValidateUnsigned for Pallet<T> {
		type Call = Call<T>;

		fn validate_unsigned(_source: TransactionSource, _call: &Self::Call) -> TransactionValidity {
			// Your implementation details here
			unimplemented!()
		}
	}
}

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

NOTE: There is also the sp_runtime::traits::SignedExtension trait that can be used to add some specific logic for transaction validation.

§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 frame_support::construct_runtime.


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