Trait fp_self_contained::SelfContainedCall
source · 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§
sourcetype SignedInfo
type SignedInfo
Validated signature info.
Required Methods§
sourcefn is_self_contained(&self) -> bool
fn is_self_contained(&self) -> bool
Returns whether the current call is a self-contained function.
sourcefn check_self_contained(
&self
) -> Option<Result<Self::SignedInfo, TransactionValidityError>>
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.
sourcefn validate_self_contained(
&self,
info: &Self::SignedInfo,
dispatch_info: &DispatchInfoOf<Self>,
len: usize
) -> Option<TransactionValidity>
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.
sourcefn apply_self_contained(
self,
info: Self::SignedInfo
) -> Option<DispatchResultWithInfo<PostDispatchInfoOf<Self>>>
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§
sourcefn pre_dispatch_self_contained(
&self,
info: &Self::SignedInfo,
dispatch_info: &DispatchInfoOf<Self>,
len: usize
) -> Option<Result<(), TransactionValidityError>>
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.