Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

establish_channel_with_system #3721

Merged
merged 29 commits into from
Apr 12, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fmt
  • Loading branch information
xlc committed Apr 3, 2024
commit 212179cb990d3155463324ca59e8ed5d8ed82fc1
13 changes: 6 additions & 7 deletions polkadot/runtime/parachains/src/hrmp/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -110,24 +110,24 @@ where
));

if matches!(until, ParachainSetupStep::Requested) {
return output
return output;
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
}

assert_ok!(Hrmp::<T>::hrmp_accept_open_channel(recipient_origin.into(), sender));
if matches!(until, ParachainSetupStep::Accepted) {
return output
return output;
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
}

Hrmp::<T>::process_hrmp_open_channel_requests(&Configuration::<T>::config());
if matches!(until, ParachainSetupStep::Established) {
return output
return output;
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
}

let channel_id = HrmpChannelId { sender, recipient };
assert_ok!(Hrmp::<T>::hrmp_close_channel(sender_origin.clone().into(), channel_id));
if matches!(until, ParachainSetupStep::CloseRequested) {
// NOTE: this is just for expressiveness, otherwise the if-statement is 100% useless.
return output
return output;
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
}

output
@@ -536,13 +536,12 @@ mod benchmarks {
#[extrinsic_call]
_(sender_origin, recipient_id);
xlc marked this conversation as resolved.
Show resolved Hide resolved

let (max_message_size, max_capacity) =
T::DefaultChannelSizeAndCapacityWithSystem::get();
let (max_message_size, max_capacity) = T::DefaultChannelSizeAndCapacityWithSystem::get();

assert_has_event::<T>(
Event::<T>::HrmpSystemChannelOpened {
sender: sender_id.into(),
recipient: recipient_id,
recipient: recipient_id,
proposed_max_capacity: max_capacity,
proposed_max_message_size: max_message_size,
}