pub trait SelfContainedCall: Dispatchable {
    type SignedInfo;

    // Required methods
    fn is_self_contained(&self) -> bool;
    fn check_self_contained(
        &self
    ) -> Option<Result<Self::SignedInfo, TransactionValidityError>>;
    fn validate_self_contained(
        &self,
        info: &Self::SignedInfo,
        dispatch_info: &DispatchInfoOf<Self>,
        len: usize
    ) -> Option<TransactionValidity>;
    fn apply_self_contained(
        self,
        info: Self::SignedInfo
    ) -> Option<DispatchResultWithInfo<PostDispatchInfoOf<Self>>>;

    // Provided method
    fn pre_dispatch_self_contained(
        &self,
        info: &Self::SignedInfo,
        dispatch_info: &DispatchInfoOf<Self>,
        len: usize
    ) -> Option<Result<(), TransactionValidityError>> { ... }
}
Expand description

A call that has self-contained functions. A self-contained function is something that has its signature embedded in its call.

Required Associated Types§

source

type SignedInfo

Validated signature info.

Required Methods§

source

fn is_self_contained(&self) -> bool

Returns whether the current call is a self-contained function.

source

fn check_self_contained( &self ) -> Option<Result<Self::SignedInfo, TransactionValidityError>>

Check signatures of a self-contained function. Returns None if the function is not a self-contained.

source

fn validate_self_contained( &self, info: &Self::SignedInfo, dispatch_info: &DispatchInfoOf<Self>, len: usize ) -> Option<TransactionValidity>

Validate a self-contained function. Returns None if the function is not a self-contained.

source

fn apply_self_contained( self, info: Self::SignedInfo ) -> Option<DispatchResultWithInfo<PostDispatchInfoOf<Self>>>

Apply a self-contained function. Returns None if the function is not a self-contained.

Provided Methods§

source

fn pre_dispatch_self_contained( &self, info: &Self::SignedInfo, dispatch_info: &DispatchInfoOf<Self>, len: usize ) -> Option<Result<(), TransactionValidityError>>

Do any pre-flight stuff for a self-contained call.

Note this function by default delegates to validate_self_contained, so that all checks performed for the transaction queue are also performed during the dispatch phase (applying the extrinsic).

If you ever override this function, you need to make sure to always perform the same validation as in validate_self_contained.

Returns None if the function is not a self-contained.

Object Safety§

This trait is not object safe.

Implementors§