Trait sov_modules_api::DispatchCall
source · pub trait DispatchCall {
type Context: Context;
type Decodable;
// Required methods
fn decode_call(serialized_message: &[u8]) -> Result<Self::Decodable, Error>;
fn dispatch_call(
&self,
message: Self::Decodable,
working_set: &mut WorkingSet<<<Self as DispatchCall>::Context as Spec>::Storage>,
context: &Self::Context
) -> Result<CallResponse, Error>;
fn module_address(
&self,
message: &Self::Decodable
) -> &<Self::Context as Spec>::Address;
}
Expand description
A trait that needs to be implemented for any call message.
Required Associated Types§
Required Methods§
sourcefn decode_call(serialized_message: &[u8]) -> Result<Self::Decodable, Error>
fn decode_call(serialized_message: &[u8]) -> Result<Self::Decodable, Error>
Decodes serialized call message
sourcefn dispatch_call(
&self,
message: Self::Decodable,
working_set: &mut WorkingSet<<<Self as DispatchCall>::Context as Spec>::Storage>,
context: &Self::Context
) -> Result<CallResponse, Error>
fn dispatch_call( &self, message: Self::Decodable, working_set: &mut WorkingSet<<<Self as DispatchCall>::Context as Spec>::Storage>, context: &Self::Context ) -> Result<CallResponse, Error>
Dispatches a call message to the appropriate module.