referrerpolicy=no-referrer-when-downgrade

Trait bp_messages::source_chain::MessagesBridge

source ·
pub trait MessagesBridge<Payload, LaneId> {
    type Error: Debug;
    type SendMessageArgs;

    // Required methods
    fn validate_message(
        lane: LaneId,
        message: &Payload,
    ) -> Result<Self::SendMessageArgs, Self::Error>;
    fn send_message(message: Self::SendMessageArgs) -> SendMessageArtifacts;
}
Expand description

Messages bridge API to be used from other pallets.

Required Associated Types§

source

type Error: Debug

Error type.

source

type SendMessageArgs

Intermediary structure returned by validate_message().

It can than be passed to send_message() in order to actually send the message on the bridge.

Required Methods§

source

fn validate_message( lane: LaneId, message: &Payload, ) -> Result<Self::SendMessageArgs, Self::Error>

Check if the message can be sent over the bridge.

source

fn send_message(message: Self::SendMessageArgs) -> SendMessageArtifacts

Send message over the bridge.

Returns unique message nonce or error if send has failed.

Object Safety§

This trait is not object safe.

Implementors§