Skip to content
Snippets Groups Projects
Commit 2731bd58 authored by Vincent Geddes's avatar Vincent Geddes Committed by GitHub
Browse files

Use correct HRMP path for parachain sibling (#366)

parent 8211ce13
Branches
No related merge requests found
......@@ -184,17 +184,21 @@ impl<T: Config> SendXcm for Module<T> {
Ok(())
}
// An HRMP message for a sibling parachain.
Some(Junction::Parachain { id }) => {
let data = msg.encode();
let hash = T::Hashing::hash(&data);
let message = OutboundHrmpMessage {
recipient: (*id).into(),
data,
};
T::HrmpMessageSender::send_hrmp_message(message)
.map_err(|_| XcmError::CannotReachDestination)?;
Self::deposit_event(RawEvent::HrmpMessageSent(hash));
Ok(())
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 {
recipient: (*id).into(),
data,
};
T::HrmpMessageSender::send_hrmp_message(message)
.map_err(|_| XcmError::CannotReachDestination)?;
Self::deposit_event(RawEvent::HrmpMessageSent(hash));
Ok(())
} else {
Err(XcmError::UnhandledXcmMessage)
}
}
_ => {
/* TODO: Handle other cases, like downward message */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment