[xcm] Foreign global consensus parachain LocationToAccountId converter (#7016)

* **Foreign** global consensus parachain LocationToAccount converter

* Review fix

* Added `UniversalLocation` + `ensure_is_remote` handling

* Added unique id to encoding

* Update xcm/xcm-builder/src/location_conversion.rs

Co-authored-by: Gavin Wood <gavin@parity.io>

* Re-export `ensure_is_remote`

* Test

* fmt

* Update xcm/xcm-builder/src/location_conversion.rs

* Update xcm/xcm-builder/src/universal_exports.rs

Co-authored-by: Gavin Wood <gavin@parity.io>

---------

Co-authored-by: parity-processbot <>
Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
Branislav Kontur
2023-05-16 10:37:31 +02:00
committed by GitHub
parent c1ca5df9e4
commit a5f4c2dfea
3 changed files with 171 additions and 8 deletions
@@ -23,7 +23,11 @@ use xcm::prelude::*;
use xcm_executor::traits::{validate_export, ExportXcm};
use SendError::*;
fn ensure_is_remote(
/// Returns the network ID and consensus location within that network of the remote
/// location `dest` which is itself specified as a location relative to the local
/// chain, itself situated at `universal_local` within the consensus universe. If
/// `dest` is not a location in remote consensus, then an error is returned.
pub fn ensure_is_remote(
universal_local: impl Into<InteriorMultiLocation>,
dest: impl Into<MultiLocation>,
) -> Result<(NetworkId, InteriorMultiLocation), MultiLocation> {