Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from all commits
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
Use correct relative path for a parachain
  • Loading branch information
vgeddes committed Feb 9, 2021
commit d4ec29215f28840d27647dfae2fcbf454fc8cc06
28 changes: 16 additions & 12 deletions xcm-handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,22 @@ 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,
};
// TODO: Better error here
T::HrmpMessageSender::send_hrmp_message(message)
.map_err(|_| XcmError::Undefined)?;
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,
};
// TODO: Better error here
T::HrmpMessageSender::send_hrmp_message(message)
.map_err(|_| XcmError::Undefined)?;
Self::deposit_event(RawEvent::HrmpMessageSent(hash));
Ok(())
} else {
Err(XcmError::UnhandledXcmMessage)
}
}
_ => {
/* TODO: Handle other cases, like downward message */
Expand Down