From b3f2f07cc5f2a9feb6aba1739c72bcd4420b08a0 Mon Sep 17 00:00:00 2001 From: Cosmin Damian <17934949+cdamian@users.noreply.github.com> Date: Sat, 17 Aug 2024 00:53:15 +0300 Subject: [PATCH] lp-gateway: Rebase fixes --- pallets/liquidity-pools-gateway/src/lib.rs | 9 +++------ .../liquidity-pools-gateway/src/message_processing.rs | 11 +++++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pallets/liquidity-pools-gateway/src/lib.rs b/pallets/liquidity-pools-gateway/src/lib.rs index 16e39e836d..2fd6e75c2f 100644 --- a/pallets/liquidity-pools-gateway/src/lib.rs +++ b/pallets/liquidity-pools-gateway/src/lib.rs @@ -662,12 +662,9 @@ pub mod pallet { (res, weight) } - GatewayMessage::Outbound { - sender, - message, - router_id, - } => { - let res = T::MessageSender::send(router_id, sender, message.serialize()); + GatewayMessage::Outbound { message, router_id } => { + let res = + T::MessageSender::send(router_id, T::Sender::get(), message.serialize()); (res, LP_DEFENSIVE_WEIGHT) } diff --git a/pallets/liquidity-pools-gateway/src/message_processing.rs b/pallets/liquidity-pools-gateway/src/message_processing.rs index eac35c05c9..377b6b7a9c 100644 --- a/pallets/liquidity-pools-gateway/src/message_processing.rs +++ b/pallets/liquidity-pools-gateway/src/message_processing.rs @@ -5,7 +5,7 @@ use cfg_types::domain_address::{Domain, DomainAddress}; use frame_support::{ dispatch::DispatchResult, ensure, - pallet_prelude::{Decode, Encode, Get, TypeInfo}, + pallet_prelude::{Decode, Encode, TypeInfo}, }; use parity_scale_codec::MaxEncodedLen; use sp_arithmetic::traits::{EnsureAddAssign, EnsureSub, SaturatedConversion}; @@ -412,7 +412,7 @@ impl Pallet { let message_hash = submessage.get_message_hash(); let inbound_entry: InboundEntry = InboundEntry::create( - submessage, + submessage.clone(), session_id, domain_address.clone(), expected_proof_count, @@ -421,6 +421,13 @@ impl Pallet { inbound_entry.validate(&router_ids, &router_id.clone())?; Self::upsert_pending_entry(message_hash, &router_id, inbound_entry)?; + Self::deposit_processing_event( + domain_address.clone(), + submessage, + message_hash, + router_id.clone(), + ); + Self::execute_if_requirements_are_met( message_hash, &router_ids,