referrerpolicy=no-referrer-when-downgrade

ValidateUnsigned

Trait ValidateUnsigned 

Source
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> { ... }
}
πŸ‘Ž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
Expand 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Β§

Source

type Call

πŸ‘Ž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

The call to validate

Required MethodsΒ§

Source

fn 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

Return 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Β§

Source

fn 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

Validate 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

SourceΒ§

type Call = RuntimeCall

πŸ‘Ž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
SourceΒ§

fn pre_dispatch( call: &<Runtime as ValidateUnsigned>::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
SourceΒ§

fn validate_unsigned( source: TransactionSource, call: &<Runtime as ValidateUnsigned>::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
SourceΒ§

impl ValidateUnsigned for Runtime

SourceΒ§

type Call = RuntimeCall

πŸ‘Ž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
SourceΒ§

fn pre_dispatch( call: &<Runtime as ValidateUnsigned>::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
SourceΒ§

fn validate_unsigned( source: TransactionSource, call: &<Runtime as ValidateUnsigned>::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
Β§

impl ValidateUnsigned for Runtime

Β§

type Call = RuntimeCall

πŸ‘Ž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: &<Runtime as ValidateUnsigned>::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 validate_unsigned( source: TransactionSource, call: &<Runtime as ValidateUnsigned>::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
Β§

impl ValidateUnsigned for Runtime

Β§

type Call = RuntimeCall

πŸ‘Ž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: &<Runtime as ValidateUnsigned>::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 validate_unsigned( source: TransactionSource, call: &<Runtime as ValidateUnsigned>::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
SourceΒ§

impl<T> ValidateUnsigned for Pallet<T>
where T: Config,

SourceΒ§

type Call = Call<T>

πŸ‘Ž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
SourceΒ§

fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

impl<T> ValidateUnsigned for Pallet<T>
where T: Config,

SourceΒ§

type Call = Call<T>

πŸ‘Ž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
SourceΒ§

fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

impl<T> ValidateUnsigned for Pallet<T>
where T: Config,

SourceΒ§

type Call = Call<T>

πŸ‘Ž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
SourceΒ§

fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

impl<T> ValidateUnsigned for Pallet<T>
where T: Config,

SourceΒ§

type Call = Call<T>

πŸ‘Ž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
SourceΒ§

fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

impl<T> ValidateUnsigned for Pallet<T>
where T: Config,

SourceΒ§

type Call = Call<T>

πŸ‘Ž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
SourceΒ§

fn validate_unsigned( _source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

impl<T> ValidateUnsigned for Pallet<T>
where T: Config,

SourceΒ§

type Call = Call<T>

πŸ‘Ž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
SourceΒ§

fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

impl<T> ValidateUnsigned for Pallet<T>
where T: Config,

SourceΒ§

type Call = Call<T>

πŸ‘Ž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
SourceΒ§

fn validate_unsigned( _source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::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
SourceΒ§

fn pre_dispatch( _call: &<Pallet<T> as ValidateUnsigned>::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
Β§

impl<T> ValidateUnsigned for Pallet<T>
where T: Config,

Β§

type Call = Call<T>

πŸ‘Ž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: &<Pallet<T> as ValidateUnsigned>::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 pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::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

ImplementorsΒ§