This repository was archived by the owner on Nov 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -184,17 +184,21 @@ impl<T: Config> SendXcm for Module<T> {
184184 Ok ( ( ) )
185185 }
186186 // An HRMP message for a sibling parachain.
187- Some ( Junction :: Parachain { id } ) => {
188- let data = msg. encode ( ) ;
189- let hash = T :: Hashing :: hash ( & data) ;
190- let message = OutboundHrmpMessage {
191- recipient : ( * id) . into ( ) ,
192- data,
193- } ;
194- T :: HrmpMessageSender :: send_hrmp_message ( message)
195- . map_err ( |_| XcmError :: CannotReachDestination ) ?;
196- Self :: deposit_event ( RawEvent :: HrmpMessageSent ( hash) ) ;
197- Ok ( ( ) )
187+ Some ( Junction :: Parent ) if dest. len ( ) == 2 => {
188+ if let Some ( Junction :: Parachain { id } ) = dest. at ( 1 ) {
189+ let data = msg. encode ( ) ;
190+ let hash = T :: Hashing :: hash ( & data) ;
191+ let message = OutboundHrmpMessage {
192+ recipient : ( * id) . into ( ) ,
193+ data,
194+ } ;
195+ T :: HrmpMessageSender :: send_hrmp_message ( message)
196+ . map_err ( |_| XcmError :: CannotReachDestination ) ?;
197+ Self :: deposit_event ( RawEvent :: HrmpMessageSent ( hash) ) ;
198+ Ok ( ( ) )
199+ } else {
200+ Err ( XcmError :: UnhandledXcmMessage )
201+ }
198202 }
199203 _ => {
200204 /* TODO: Handle other cases, like downward message */
You can’t perform that action at this time.
0 commit comments