Skip to content

Commit

Permalink
Remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr committed Nov 29, 2024
1 parent a6a0406 commit 1b43681
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions polkadot/runtime/parachains/src/dmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,19 +225,7 @@ impl<T: Config> Pallet<T> {
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::<T>::contains_key(para) {
return Err(QueueDownwardMessageError::Unroutable)
}
Self::can_queue_downward_message(config, &para, &msg)?;

let inbound =
InboundDownwardMessage { msg, sent_at: frame_system::Pallet::<T>::block_number() };
Expand Down

0 comments on commit 1b43681

Please sign in to comment.