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§

source

fn decode_call(serialized_message: &[u8]) -> Result<Self::Decodable, Error>

Decodes serialized call message

source

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.

source

fn module_address( &self, message: &Self::Decodable ) -> &<Self::Context as Spec>::Address

Returns an address of the dispatched module.

Implementors§