From c90bfedb17bde86ab957520b66058891c6b01401 Mon Sep 17 00:00:00 2001 From: ron Date: Mon, 28 Oct 2024 23:51:17 +0800 Subject: [PATCH] Emit the entire message --- bridges/snowbridge/pallets/outbound-queue-v2/src/lib.rs | 4 ++-- .../pallets/outbound-queue-v2/src/send_message_impl.rs | 2 +- bridges/snowbridge/primitives/core/src/outbound/v2.rs | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bridges/snowbridge/pallets/outbound-queue-v2/src/lib.rs b/bridges/snowbridge/pallets/outbound-queue-v2/src/lib.rs index 41427c0f9d28..8211646bcb82 100644 --- a/bridges/snowbridge/pallets/outbound-queue-v2/src/lib.rs +++ b/bridges/snowbridge/pallets/outbound-queue-v2/src/lib.rs @@ -187,8 +187,8 @@ pub mod pallet { pub enum Event { /// 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`. diff --git a/bridges/snowbridge/pallets/outbound-queue-v2/src/send_message_impl.rs b/bridges/snowbridge/pallets/outbound-queue-v2/src/send_message_impl.rs index 7c75005e5526..3324e5c01658 100644 --- a/bridges/snowbridge/pallets/outbound-queue-v2/src/send_message_impl.rs +++ b/bridges/snowbridge/pallets/outbound-queue-v2/src/send_message_impl.rs @@ -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) } } diff --git a/bridges/snowbridge/primitives/core/src/outbound/v2.rs b/bridges/snowbridge/primitives/core/src/outbound/v2.rs index a3719a3c0473..11c2b3d97e0b 100644 --- a/bridges/snowbridge/primitives/core/src/outbound/v2.rs +++ b/bridges/snowbridge/primitives/core/src/outbound/v2.rs @@ -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, @@ -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 {