diff --git a/runtime/parachains/src/hrmp.rs b/runtime/parachains/src/hrmp.rs index 025addbc9184..1895809c0e04 100644 --- a/runtime/parachains/src/hrmp.rs +++ b/runtime/parachains/src/hrmp.rs @@ -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(::WeightInfo::hrmp_init_open_channel() + ::WeightInfo::hrmp_accept_open_channel())] + pub fn force_establish_hrmp_channel( + origin: OriginFor, + 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) + } + /// Initiate unilateral closing of a channel. The origin must be either the sender or the /// recipient in the channel being closed. ///