pub trait ValidateUnsigned {
type Call;
// Required method
fn validate_unsigned(
source: TransactionSource,
call: &Self::Call,
) -> Result<ValidTransaction, TransactionValidityError>;
// Provided method
fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError> { ... }
}ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Expand description
Provide validation for unsigned extrinsics.
This trait provides two functions pre_dispatch and
validate_unsigned. The pre_dispatch
function is called right before dispatching the call wrapped by an unsigned extrinsic. The
validate_unsigned function is mainly being used in the context of
the transaction pool to check the validity of the call wrapped by an unsigned extrinsic.
Β§Deprecation Notice
This trait is deprecated and will be removed after April 2027. Use
#[pallet::authorize] with frame_system::AuthorizeCall transaction extension instead.
For more information, see: https://github.com/paritytech/polkadot-sdk/issues/2415
Required Associated TypesΒ§
Required MethodsΒ§
Sourcefn validate_unsigned(
source: TransactionSource,
call: &Self::Call,
) -> Result<ValidTransaction, TransactionValidityError>
πDeprecated: ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415
fn validate_unsigned( source: TransactionSource, call: &Self::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Return the validity of the call
This method has no side-effects. It merely checks whether the call would be rejected by the runtime in an unsigned extrinsic.
The validity checks should be as lightweight as possible because every node will execute this code before the unsigned extrinsic enters the transaction pool and also periodically afterwards to ensure the validity. To prevent dos-ing a network with unsigned extrinsics, these validity checks should include some checks around uniqueness, for example, checking that the unsigned extrinsic was sent by an authority in the active set.
Changes made to storage should be discarded by caller.
Provided MethodsΒ§
Sourcefn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError>
πDeprecated: ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415
fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Validate the call right before dispatch.
This method should be used to prevent transactions already in the pool
(i.e. passing validate_unsigned) from being included in blocks
in case they became invalid since being added to the pool.
By default itβs a good idea to call validate_unsigned from
within this function again to make sure we never include an invalid transaction. Otherwise
the implementation of the call or this method will need to provide proper validation to
ensure that the transaction is valid.
Changes made to storage WILL be persisted if the call returns Ok.
Dyn CompatibilityΒ§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign TypesΒ§
SourceΒ§impl ValidateUnsigned for Runtime
impl ValidateUnsigned for Runtime
SourceΒ§type Call = RuntimeCall
type Call = RuntimeCall
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn pre_dispatch(
call: &<Runtime as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Runtime as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn validate_unsigned(
source: TransactionSource,
call: &<Runtime as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Runtime as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§impl ValidateUnsigned for Runtime
impl ValidateUnsigned for Runtime
SourceΒ§type Call = RuntimeCall
type Call = RuntimeCall
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn pre_dispatch(
call: &<Runtime as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Runtime as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn validate_unsigned(
source: TransactionSource,
call: &<Runtime as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Runtime as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Β§impl ValidateUnsigned for Runtime
impl ValidateUnsigned for Runtime
Β§type Call = RuntimeCall
type Call = RuntimeCall
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Β§fn pre_dispatch(
call: &<Runtime as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Runtime as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Β§fn validate_unsigned(
source: TransactionSource,
call: &<Runtime as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Runtime as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Β§impl ValidateUnsigned for Runtime
impl ValidateUnsigned for Runtime
Β§type Call = RuntimeCall
type Call = RuntimeCall
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Β§fn pre_dispatch(
call: &<Runtime as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Runtime as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Β§fn validate_unsigned(
source: TransactionSource,
call: &<Runtime as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Runtime as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
SourceΒ§type Call = Call<T>
type Call = Call<T>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn validate_unsigned(
source: TransactionSource,
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
SourceΒ§type Call = Call<T>
type Call = Call<T>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn validate_unsigned(
source: TransactionSource,
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn pre_dispatch(
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
SourceΒ§type Call = Call<T>
type Call = Call<T>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn pre_dispatch(
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn validate_unsigned(
source: TransactionSource,
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
SourceΒ§type Call = Call<T>
type Call = Call<T>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn validate_unsigned(
source: TransactionSource,
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn pre_dispatch(
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
SourceΒ§type Call = Call<T>
type Call = Call<T>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn validate_unsigned(
_source: TransactionSource,
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( _source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
SourceΒ§type Call = Call<T>
type Call = Call<T>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn validate_unsigned(
source: TransactionSource,
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn pre_dispatch(
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
SourceΒ§type Call = Call<T>
type Call = Call<T>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn validate_unsigned(
_source: TransactionSource,
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( _source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415SourceΒ§fn pre_dispatch(
_call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( _call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Β§impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
Β§type Call = Call<T>
type Call = Call<T>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Β§fn validate_unsigned(
source: TransactionSource,
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415Β§fn pre_dispatch(
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
ValidateUnsigned will be removed after April 2027. Use #[pallet::authorize] with frame_system::AuthorizeCall instead. See https://github.com/paritytech/polkadot-sdk/issues/2415