From 1b43681acb8cf5a0ef36ce8e5e53a932d7791f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 29 Nov 2024 21:49:19 +0000 Subject: [PATCH] Remove duplicate code --- polkadot/runtime/parachains/src/dmp.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/polkadot/runtime/parachains/src/dmp.rs b/polkadot/runtime/parachains/src/dmp.rs index 111560708045..1bebe5f83052 100644 --- a/polkadot/runtime/parachains/src/dmp.rs +++ b/polkadot/runtime/parachains/src/dmp.rs @@ -225,19 +225,7 @@ impl Pallet { msg: DownwardMessage, ) -> Result<(), QueueDownwardMessageError> { let serialized_len = msg.len() as u32; - if serialized_len > config.max_downward_message_size { - return Err(QueueDownwardMessageError::ExceedsMaxMessageSize) - } - - // Hard limit on Queue size - if Self::dmq_length(para) > Self::dmq_max_length(config.max_downward_message_size) { - return Err(QueueDownwardMessageError::ExceedsMaxMessageSize) - } - - // If the head exists, we assume the parachain is legit and exists. - if !paras::Heads::::contains_key(para) { - return Err(QueueDownwardMessageError::Unroutable) - } + Self::can_queue_downward_message(config, ¶, &msg)?; let inbound = InboundDownwardMessage { msg, sent_at: frame_system::Pallet::::block_number() };