cumulus
cumulus copied to clipboard
Fix all ignored system parachain integration tests
Related discussions: #3026 #3023 - in #2300 I'm simply ignoring the tests to enable a merge, but a fix to the tests should be forthcoming afterwards.
https://github.com/paritytech/cumulus/pull/2300/commits/17db1fbd29dbfd4f071a3326f6798df402f01e27 <- this commit shows the ignoring of tests.
I think that set_validation_data is hack just for opening HRMP channel,
we use different kind of hack for hrmp for benchmarks:
/// Open HRMP channel for using it in tests.
///
/// The caller assumes that the pallet will accept regular outbound message to the sibling
/// `target_parachain` after this call. No other assumptions are made.
pub fn open_outbound_hrmp_channel_for_tests(_target_parachain: ParaId) {
// #[cfg(any(test, feature = "runtime-benchmarks"))]
RelevantMessagingState::<T>::put(MessagingStateSnapshot {
dmq_mqc_head: Default::default(),
relay_dispatch_queue_remaining_capacity: Default::default(),
ingress_channels: Default::default(),
egress_channels: vec![(
_target_parachain,
cumulus_primitives_core::AbridgedHrmpChannel {
max_capacity: 10,
max_total_size: 10_000_000_u32,
max_message_size: 10_000_000_u32,
msg_count: 5,
total_size: 5_000_000_u32,
mqc_head: None,
},
)],
})
}
so maybe we could just do this hack in emulator like this:
// open hrmp channel to para_id
<Self as Parachain>::ParachainSystem::open_outbound_hrmp_channel_for_tests(para_id);
// let _ = <Self as Parachain>::ParachainSystem::set_validation_data(
// <Self as Chain>::RuntimeOrigin::none(),
// <Self as NetworkComponent>::Network::hrmp_channel_parachain_inherent_data(
// para_id.into(),
// relay_block_number,
// ),
// );
// set `AnnouncedHrmpMessagesPerCandidate`
and we dont need to handle block creation or other stuff,
I will take a try next week