Skip to content
Snippets Groups Projects
Commit b2fa308d authored by Ignacio Palacios's avatar Ignacio Palacios Committed by GitHub
Browse files

Fix for `xcm-emulator` - Wrong Parachain processing message (#2800)

* fix

* forgot para_id

* remove unreachable code
parent 6b8be7a6
Branches
No related merge requests found
......@@ -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()));
......@@ -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!();
}
)*
}
......@@ -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());
}
)*
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment