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§
sourcetype SendMessageArgs
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§
sourcefn validate_message(
lane: LaneId,
message: &Payload,
) -> Result<Self::SendMessageArgs, Self::Error>
fn validate_message( lane: LaneId, message: &Payload, ) -> Result<Self::SendMessageArgs, Self::Error>
Check if the message can be sent over the bridge.
sourcefn send_message(message: Self::SendMessageArgs) -> SendMessageArtifacts
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.