pub trait EndpointHandler<MessageId> {
// Required methods
fn message(
&self,
src_chain_id: ChainId,
message_id: MessageId,
req: EndpointRequest,
) -> EndpointResponse;
fn message_weight(&self) -> Weight;
fn message_response(
&self,
dst_chain_id: ChainId,
message_id: MessageId,
req: EndpointRequest,
resp: EndpointResponse,
) -> DispatchResult;
fn message_response_weight(&self) -> Weight;
}
Expand description
Handler to
- handle message request from other chains.
- handle requested message responses from other chains.
Required Methods§
sourcefn message(
&self,
src_chain_id: ChainId,
message_id: MessageId,
req: EndpointRequest,
) -> EndpointResponse
fn message( &self, src_chain_id: ChainId, message_id: MessageId, req: EndpointRequest, ) -> EndpointResponse
Triggered by pallet-messenger when a new inbox message is received and bound for this handler.
sourcefn message_weight(&self) -> Weight
fn message_weight(&self) -> Weight
Return the maximal possible consume weight of message
sourcefn message_response(
&self,
dst_chain_id: ChainId,
message_id: MessageId,
req: EndpointRequest,
resp: EndpointResponse,
) -> DispatchResult
fn message_response( &self, dst_chain_id: ChainId, message_id: MessageId, req: EndpointRequest, resp: EndpointResponse, ) -> DispatchResult
Triggered by pallet-messenger when a response for a request is received from dst_chain_id.
sourcefn message_response_weight(&self) -> Weight
fn message_response_weight(&self) -> Weight
Return the maximal possible consume weight of message_response