Skip to content

Commit

Permalink
dirty fix to fix Hrmp test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lemunozm committed Jun 6, 2024
1 parent beb13f0 commit f2b2934
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
32 changes: 18 additions & 14 deletions runtime/integration-tests/src/generic/envs/fudge_env/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,7 @@ pub trait FudgeHandle<T: Runtime> {
Self::RelayRuntime,
>::default();

let mut host_config = HostConfiguration::default();
host_config.max_downward_message_size = 1024;
host_config.hrmp_channel_max_capacity = 100;
host_config.hrmp_channel_max_message_size = 1024;
host_config.hrmp_channel_max_total_size = 1024;
host_config.hrmp_max_parachain_outbound_channels = 10;
host_config.hrmp_max_parachain_inbound_channels = 10;
host_config.hrmp_max_message_num_per_candidate = 100;
host_config.max_upward_queue_count = 10;
host_config.max_upward_queue_size = 1024;
host_config.max_upward_message_size = 1024;
host_config.max_upward_message_num_per_candidate = 100;

configuration.config = host_config;
configuration.config = hrmp_host_config();

state
.insert_storage(
Expand Down Expand Up @@ -363,3 +350,20 @@ pub trait FudgeHandle<T: Runtime> {
runtime
}
}

pub fn hrmp_host_config<BlockNumber: Default + From<u32>>() -> HostConfiguration<BlockNumber> {
HostConfiguration {
max_downward_message_size: 1024,
hrmp_channel_max_capacity: 100,
hrmp_channel_max_message_size: 1024,
hrmp_channel_max_total_size: 1024,
hrmp_max_parachain_outbound_channels: 10,
hrmp_max_parachain_inbound_channels: 10,
hrmp_max_message_num_per_candidate: 100,
max_upward_queue_count: 10,
max_upward_queue_size: 1024,
max_upward_message_size: 1024,
max_upward_message_num_per_candidate: 100,
..Default::default()
}
}
9 changes: 8 additions & 1 deletion runtime/integration-tests/src/generic/utils/xcm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ use staging_xcm::{
use crate::generic::{
config::Runtime,
env::{Blocks, Env},
envs::fudge_env::{handle::FudgeHandle, FudgeEnv, FudgeRelayRuntime, FudgeSupport},
envs::fudge_env::{
handle::{hrmp_host_config, FudgeHandle},
FudgeEnv, FudgeRelayRuntime, FudgeSupport,
},
};

pub fn setup_xcm<T: Runtime + FudgeSupport>(env: &mut FudgeEnv<T>) {
Expand Down Expand Up @@ -37,6 +40,10 @@ pub fn setup_xcm<T: Runtime + FudgeSupport>(env: &mut FudgeEnv<T>) {
});

env.relay_state_mut(|| {
polkadot_runtime_parachains::configuration::Pallet::<FudgeRelayRuntime<T>>::force_set_active_config(
hrmp_host_config()
);

assert_ok!(polkadot_runtime_parachains::hrmp::Pallet::<
FudgeRelayRuntime<T>,
>::force_open_hrmp_channel(
Expand Down

0 comments on commit f2b2934

Please sign in to comment.