Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fix for xcm-emulator - Wrong Parachain processing message (#2800)
Browse files Browse the repository at this point in the history
* fix

* forgot para_id

* remove unreachable code
  • Loading branch information
NachoPal authored Jul 2, 2023
1 parent a10cf98 commit d978452
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions xcm/xcm-emulator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,9 @@ macro_rules! decl_test_networks {
while let Some((to_para_id, messages))
= $crate::DOWNWARD_MESSAGES.with(|b| b.borrow_mut().get_mut(stringify!($name)).unwrap().pop_front()) {
$(
if $crate::PARA_IDS.with(|b| b.borrow_mut().get_mut(stringify!($name)).unwrap().contains(&to_para_id)) {
let para_id: u32 = <$parachain>::para_id().into();

if $crate::PARA_IDS.with(|b| b.borrow_mut().get_mut(stringify!($name)).unwrap().contains(&to_para_id)) && para_id == to_para_id {
let mut msg_dedup: Vec<(RelayChainBlockNumber, Vec<u8>)> = Vec::new();
for m in &messages {
msg_dedup.push((m.0, m.1.clone()));
Expand All @@ -796,8 +798,6 @@ macro_rules! decl_test_networks {
$crate::DMP_DONE.with(|b| b.borrow_mut().get_mut(stringify!($name)).unwrap().push_back((to_para_id, m.0, m.1)));
}
}
} else {
unreachable!();
}
)*
}
Expand All @@ -810,7 +810,9 @@ macro_rules! decl_test_networks {
= $crate::HORIZONTAL_MESSAGES.with(|b| b.borrow_mut().get_mut(stringify!($name)).unwrap().pop_front()) {
let iter = messages.iter().map(|(p, b, m)| (*p, *b, &m[..])).collect::<Vec<_>>().into_iter();
$(
if $crate::PARA_IDS.with(|b| b.borrow_mut().get_mut(stringify!($name)).unwrap().contains(&to_para_id)) {
let para_id: u32 = <$parachain>::para_id().into();

if $crate::PARA_IDS.with(|b| b.borrow_mut().get_mut(stringify!($name)).unwrap().contains(&to_para_id)) && para_id == to_para_id {
<$parachain>::handle_xcmp_messages(iter.clone(), $crate::Weight::max_value());
}
)*
Expand Down

0 comments on commit d978452

Please sign in to comment.