Comanion for substrate#11136 (#5218)

* Comanion for substrate#11136

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* revert changes in bridge

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
Qinxuan Chen
2022-04-04 17:13:34 +08:00
committed by GitHub
parent 8f784d592a
commit 74078d8eb9
65 changed files with 48 additions and 115 deletions
@@ -96,7 +96,7 @@ fn generate_conversion_from_v1() -> TokenStream {
.collect::<TokenStream>();
quote! {
impl core::convert::TryFrom<crate::v1::MultiLocation> for MultiLocation {
impl TryFrom<crate::v1::MultiLocation> for MultiLocation {
type Error = ();
fn try_from(v1: crate::v1::MultiLocation) -> core::result::Result<Self, ()> {
let mut res = MultiLocation::Null;
@@ -172,7 +172,7 @@ fn generate_conversion_from_v0() -> TokenStream {
if #( #parent_idents.is_parent() )&&* =>
Ok(MultiLocation {
parents: #parent_count,
interior: #junction_variant( #( core::convert::TryInto::try_into(#junction_idents)? ),* ),
interior: #junction_variant( #( TryInto::try_into(#junction_idents)? ),* ),
}),
}
})
@@ -184,7 +184,7 @@ fn generate_conversion_from_v0() -> TokenStream {
Ok(MultiLocation::ancestor(#num_ancestors)),
#intermediate_match_arms
crate::v0::MultiLocation::#variant( #(#idents),* ) =>
Ok( #variant( #( core::convert::TryInto::try_into(#idents)? ),* ).into() ),
Ok( #variant( #( TryInto::try_into(#idents)? ),* ).into() ),
}
})
.collect::<TokenStream>();