Trait sp_runtime::traits::Applyable
source · pub trait Applyable: Sized + Send + Sync {
type Call: Dispatchable;
// Required methods
fn validate<V: ValidateUnsigned<Call = Self::Call>>(
&self,
source: TransactionSource,
info: &DispatchInfoOf<Self::Call>,
len: usize
) -> TransactionValidity;
fn apply<V: ValidateUnsigned<Call = Self::Call>>(
self,
info: &DispatchInfoOf<Self::Call>,
len: usize
) -> ApplyExtrinsicResultWithInfo<PostDispatchInfoOf<Self::Call>>;
}
Expand description
An “executable” piece of information, used by the standard Substrate Executive in order to enact a piece of extrinsic information by marshalling and dispatching to a named function call.
Also provides information on to whom this information is attributable and an index that allows each piece of attributable information to be disambiguated.
Required Associated Types§
sourcetype Call: Dispatchable
type Call: Dispatchable
Type by which we can dispatch. Restricts the UnsignedValidator
type.
Required Methods§
sourcefn validate<V: ValidateUnsigned<Call = Self::Call>>(
&self,
source: TransactionSource,
info: &DispatchInfoOf<Self::Call>,
len: usize
) -> TransactionValidity
fn validate<V: ValidateUnsigned<Call = Self::Call>>( &self, source: TransactionSource, info: &DispatchInfoOf<Self::Call>, len: usize ) -> TransactionValidity
Checks to see if this is a valid transaction. It returns information on it if so.
sourcefn apply<V: ValidateUnsigned<Call = Self::Call>>(
self,
info: &DispatchInfoOf<Self::Call>,
len: usize
) -> ApplyExtrinsicResultWithInfo<PostDispatchInfoOf<Self::Call>>
fn apply<V: ValidateUnsigned<Call = Self::Call>>( self, info: &DispatchInfoOf<Self::Call>, len: usize ) -> ApplyExtrinsicResultWithInfo<PostDispatchInfoOf<Self::Call>>
Executes all necessary logic needed prior to dispatch and deconstructs into function call, index and sender.
Object Safety§
This trait is not object safe.