Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
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
23 changes: 23 additions & 0 deletions runtime/parachains/src/hrmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,29 @@ pub mod pallet {
Ok(())
}

/// Sudo 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`.
#[pallet::weight(<T as Config>::WeightInfo::hrmp_init_open_channel() + <T as Config>::WeightInfo::hrmp_accept_open_channel())]
pub fn sudo_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)?;
Ok(())
}

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