Reanchor should return canonical location (#4470)

* Reanchor should return canonical

* Formatting

* Formatting

* Update xcm/src/v1/multilocation.rs

* Formatting

* Fixes

* Don't discard unreanchorable assets

* Formatting

* Docs

* Fixes

* Fixes

* tidy
This commit is contained in:
Gavin Wood
2021-12-14 09:21:34 +01:00
committed by GitHub
parent ca72ad636c
commit 32bb94afff
8 changed files with 241 additions and 34 deletions
@@ -182,6 +182,9 @@ impl<Network: Get<NetworkId>, AccountId: From<[u8; 20]> + Into<[u8; 20]> + Clone
/// ```
pub struct LocationInverter<Ancestry>(PhantomData<Ancestry>);
impl<Ancestry: Get<MultiLocation>> InvertLocation for LocationInverter<Ancestry> {
fn ancestry() -> MultiLocation {
Ancestry::get()
}
fn invert_location(location: &MultiLocation) -> Result<MultiLocation, ()> {
let mut ancestry = Ancestry::get();
let mut junctions = Here;