Skip to content

Commit

Permalink
Move MessageReceived ahead
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Dec 20, 2024
1 parent fab5bc9 commit e30bf90
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bridges/snowbridge/pallets/inbound-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ pub mod pallet {
let envelope =
Envelope::try_from(&message.event_log).map_err(|_| Error::<T>::InvalidEnvelope)?;

Self::deposit_event(Event::MessageReceived {
channel_id: envelope.channel_id,
nonce: envelope.nonce,
message_id: envelope.message_id.into(),
});

// Verify that the message was submitted from the known Gateway contract
ensure!(T::GatewayAddress::get() == envelope.gateway, Error::<T>::InvalidGateway);

Expand Down Expand Up @@ -279,12 +285,6 @@ pub mod pallet {
let message = VersionedMessage::decode_all(&mut envelope.payload.as_ref())
.map_err(|_| Error::<T>::InvalidPayload)?;

Self::deposit_event(Event::MessageReceived {
channel_id: envelope.channel_id,
nonce: envelope.nonce,
message_id: envelope.message_id.into(),
});

// Decode message into XCM
let (xcm, fee) = Self::do_convert(envelope.message_id, message.clone())?;

Expand Down

0 comments on commit e30bf90

Please sign in to comment.