Improve MultiLocation conversion functions in xcm-procedural (#3690)

* Use fully-qualified paths to reference core traits in proc macro

* Ensure a canonicalized v0 MultiLocation first before attempting to convert to v1

* Fix failing test
This commit is contained in:
Keith Yeung
2021-08-23 03:37:15 -07:00
committed by GitHub
parent a707f2367c
commit 81692bd176
4 changed files with 10 additions and 11 deletions
+2 -5
View File
@@ -17,10 +17,7 @@
//! Cross-Consensus Message format data structures.
use super::Junction;
use core::{
convert::{TryFrom, TryInto},
mem, result,
};
use core::{convert::TryFrom, mem, result};
use parity_scale_codec::{Decode, Encode};
/// A relative path between state-bearing consensus systems.
@@ -898,7 +895,7 @@ mod tests {
);
assert_eq!(
v0::MultiLocation::X2(v0::Junction::Parachain(88), v0::Junction::Parent).try_into(),
Err::<MultiLocation, ()>(()),
Ok(MultiLocation::here()),
);
assert_eq!(
v0::MultiLocation::X3(