Use correct HRMP path for parachain sibling (#366)

This commit is contained in:
Vincent Geddes
2021-03-16 19:23:22 +02:00
committed by GitHub
parent 8211ce13df
commit 2731bd5858
+5 -1
View File
@@ -184,7 +184,8 @@ impl<T: Config> SendXcm for Module<T> {
Ok(())
}
// An HRMP message for a sibling parachain.
Some(Junction::Parachain { id }) => {
Some(Junction::Parent) if dest.len() == 2 => {
if let Some(Junction::Parachain { id }) = dest.at(1) {
let data = msg.encode();
let hash = T::Hashing::hash(&data);
let message = OutboundHrmpMessage {
@@ -195,6 +196,9 @@ impl<T: Config> SendXcm for Module<T> {
.map_err(|_| XcmError::CannotReachDestination)?;
Self::deposit_event(RawEvent::HrmpMessageSent(hash));
Ok(())
} else {
Err(XcmError::UnhandledXcmMessage)
}
}
_ => {
/* TODO: Handle other cases, like downward message */