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

Fix for xcm-emulator - Wrong Parachain processing message #2800

Merged
merged 3 commits into from
Jul 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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