Introduce plurality XCM locations (#2846)

* Introduce plurality XCM locations

* Add RelayedFrom
This commit is contained in:
Gavin Wood
2021-04-08 20:58:06 +02:00
committed by GitHub
parent 57038b2e46
commit 9b4844e853
4 changed files with 101 additions and 10 deletions
+8
View File
@@ -182,6 +182,14 @@ impl<Config: config::Config> XcmExecutor<Config> {
Config::ResponseHandler::on_response(origin, query_id, response);
None
}
(origin, Xcm::RelayedFrom { who, message }) => {
ensure!(who.is_interior(), XcmError::EscalationOfPrivilege);
let mut origin = origin;
origin.append_with(who).map_err(|_| XcmError::MultiLocationFull)?;
let surplus = Self::do_execute_xcm(origin, top_level, *message, weight_credit, None, trader)?;
total_surplus = total_surplus.saturating_add(surplus);
None
}
_ => Err(XcmError::UnhandledXcmMessage)?, // Unhandled XCM message.
};