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

sudo call to establish hrmp channel #4998

Closed
Closed
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
24 changes: 24 additions & 0 deletions runtime/parachains/src/hrmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,30 @@ pub mod pallet {
Ok(())
}

/// Call to establish a channel from the sender to the recipient.
///
/// This is equivalent to sending an `hrmp_init_open_channel` extrinsic followed by
/// `hrmp_accept_open_channel`.
///
/// Origin must be Root.
#[pallet::weight(<T as Config>::WeightInfo::hrmp_init_open_channel() + <T as Config>::WeightInfo::hrmp_accept_open_channel())]
pub fn force_establish_hrmp_channel(
origin: OriginFor<T>,
sender: ParaId,
recipient: ParaId,
proposed_max_capacity: u32,
proposed_max_message_size: u32,
) -> DispatchResult {
ensure_root(origin)?;
Self::init_open_channel(
sender,
recipient,
proposed_max_capacity,
proposed_max_message_size,
)?;
Self::accept_open_channel(recipient, sender)
}
gilescope marked this conversation as resolved.
Show resolved Hide resolved

/// Initiate unilateral closing of a channel. The origin must be either the sender or the
/// recipient in the channel being closed.
///
Expand Down