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 7e69e68
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7197,6 +7197,15 @@ mod centrifuge {
Default::default(),
);

// Configuring XCM in this test fails because the Hrmp
// configuration is not applied. We force the application here,
// but we should configure correctly this because something is off.
env.relay_state_mut(|| {
polkadot_runtime_parachains::configuration::Pallet::<FudgeRelayRuntime<T>>::force_set_active_config(
crate::generic::envs::fudge_env::handle::hrmp_host_config()
);
});

setup_xcm(&mut env);

setup_usdc_xcm(&mut env);
Expand Down
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()
}
}

0 comments on commit 7e69e68

Please sign in to comment.