Skip to content

Commit

Permalink
Emit the entire message
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Oct 28, 2024
1 parent 4796240 commit c90bfed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bridges/snowbridge/pallets/outbound-queue-v2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ pub mod pallet {
pub enum Event<T: Config> {
/// Message has been queued and will be processed in the future
MessageQueued {
/// ID of the message. Usually the XCM message hash or a SetTopic.
id: H256,
/// The message
message: Message,
},
/// Message will be committed at the end of current block. From now on, to track the
/// progress the message, use the `nonce` of `id`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ where
BoundedVec::try_from(ticket.encode()).map_err(|_| SendError::MessageTooLarge)?;

T::MessageQueue::enqueue_message(message.as_bounded_slice(), origin);
Self::deposit_event(Event::MessageQueued { id: ticket.id });
Self::deposit_event(Event::MessageQueued { message: ticket.clone() });
Ok(ticket.id)
}
}
Expand Down
6 changes: 2 additions & 4 deletions bridges/snowbridge/primitives/core/src/outbound/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ sol! {
pub const MAX_COMMANDS: u32 = 8;

/// A message which can be accepted by implementations of `/[`SendMessage`\]`
#[derive(Encode, Decode, TypeInfo, Clone, RuntimeDebug)]
#[cfg_attr(feature = "std", derive(PartialEq))]
#[derive(Encode, Decode, TypeInfo, PartialEq, Clone, RuntimeDebug)]
pub struct Message {
/// Origin
pub origin: H256,
Expand All @@ -107,8 +106,7 @@ pub struct Message {
}

/// A command which is executable by the Gateway contract on Ethereum
#[derive(Clone, Encode, Decode, RuntimeDebug, TypeInfo)]
#[cfg_attr(feature = "std", derive(PartialEq))]
#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)]
pub enum Command {
/// Upgrade the Gateway contract
Upgrade {
Expand Down

0 comments on commit c90bfed

Please sign in to comment.