mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
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:
@@ -22,7 +22,7 @@ use frame_support::{
|
||||
traits::fungible::{Inspect, Mutate},
|
||||
};
|
||||
use sp_runtime::traits::{Bounded, Zero};
|
||||
use sp_std::{convert::TryInto, prelude::*, vec};
|
||||
use sp_std::{prelude::*, vec};
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_executor::traits::{Convert, TransactAsset};
|
||||
|
||||
|
||||
@@ -30,14 +30,7 @@ use sp_runtime::{
|
||||
traits::{BadOrigin, Saturating},
|
||||
RuntimeDebug,
|
||||
};
|
||||
use sp_std::{
|
||||
boxed::Box,
|
||||
convert::{TryFrom, TryInto},
|
||||
marker::PhantomData,
|
||||
prelude::*,
|
||||
result::Result,
|
||||
vec,
|
||||
};
|
||||
use sp_std::{boxed::Box, marker::PhantomData, prelude::*, result::Result, vec};
|
||||
use xcm::prelude::*;
|
||||
use xcm_executor::traits::ConvertOrigin;
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ use frame_support::{
|
||||
};
|
||||
use polkadot_parachain::primitives::{AccountIdConversion, Id as ParaId};
|
||||
use sp_runtime::traits::{BlakeTwo256, Hash};
|
||||
use std::convert::TryInto;
|
||||
use xcm::prelude::*;
|
||||
use xcm_builder::AllowKnownQueryResponses;
|
||||
use xcm_executor::{traits::ShouldExecute, XcmExecutor};
|
||||
|
||||
@@ -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>();
|
||||
|
||||
@@ -24,10 +24,6 @@
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use core::{
|
||||
convert::{TryFrom, TryInto},
|
||||
result::Result,
|
||||
};
|
||||
use derivative::Derivative;
|
||||
use parity_scale_codec::{Decode, Encode, Error as CodecError, Input};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -18,10 +18,7 @@
|
||||
|
||||
use crate::DoubleEncoded;
|
||||
use alloc::vec::Vec;
|
||||
use core::{
|
||||
convert::{TryFrom, TryInto},
|
||||
result,
|
||||
};
|
||||
use core::result;
|
||||
use derivative::Derivative;
|
||||
use parity_scale_codec::{self, Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
use super::MultiLocation;
|
||||
use crate::v1::{MultiAssetFilter, MultiAssets, WildMultiAsset};
|
||||
use alloc::{vec, vec::Vec};
|
||||
use core::{
|
||||
convert::{TryFrom, TryInto},
|
||||
result,
|
||||
};
|
||||
use core::result;
|
||||
use parity_scale_codec::{self, Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
|
||||
@@ -694,7 +694,6 @@ mod tests {
|
||||
#[test]
|
||||
fn conversion_from_other_types_works() {
|
||||
use crate::v1::{self, Junction, Junctions};
|
||||
use core::convert::TryInto;
|
||||
|
||||
fn takes_multilocation<Arg: Into<MultiLocation>>(_arg: Arg) {}
|
||||
|
||||
|
||||
@@ -18,10 +18,7 @@
|
||||
|
||||
use super::{super::v1::Order as Order1, MultiAsset, MultiLocation, Xcm};
|
||||
use alloc::vec::Vec;
|
||||
use core::{
|
||||
convert::{TryFrom, TryInto},
|
||||
result,
|
||||
};
|
||||
use core::result;
|
||||
use derivative::Derivative;
|
||||
use parity_scale_codec::{self, Decode, Encode};
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
use super::{BodyId, BodyPart, Junctions, MultiLocation, NetworkId};
|
||||
use crate::v0::Junction as Junction0;
|
||||
use alloc::vec::Vec;
|
||||
use core::convert::TryFrom;
|
||||
use parity_scale_codec::{self, Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
|
||||
@@ -66,11 +66,7 @@ use super::{
|
||||
};
|
||||
use crate::DoubleEncoded;
|
||||
use alloc::vec::Vec;
|
||||
use core::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt::Debug,
|
||||
result,
|
||||
};
|
||||
use core::{fmt::Debug, result};
|
||||
use derivative::Derivative;
|
||||
use parity_scale_codec::{self, Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -25,11 +25,7 @@
|
||||
|
||||
use super::MultiLocation;
|
||||
use alloc::{vec, vec::Vec};
|
||||
use core::{
|
||||
cmp::Ordering,
|
||||
convert::{TryFrom, TryInto},
|
||||
result,
|
||||
};
|
||||
use core::{cmp::Ordering, result};
|
||||
use parity_scale_codec::{self as codec, Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Cross-Consensus Message format data structures.
|
||||
|
||||
use super::Junction;
|
||||
use core::{convert::TryFrom, mem, result};
|
||||
use core::{mem, result};
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -1011,7 +1011,6 @@ mod tests {
|
||||
#[test]
|
||||
fn conversion_from_other_types_works() {
|
||||
use crate::v0;
|
||||
use core::convert::TryInto;
|
||||
|
||||
fn takes_multilocation<Arg: Into<MultiLocation>>(_arg: Arg) {}
|
||||
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
use super::{MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Xcm};
|
||||
use crate::{v0::Order as OldOrder, v2::Instruction};
|
||||
use alloc::{vec, vec::Vec};
|
||||
use core::{
|
||||
convert::{TryFrom, TryInto},
|
||||
result,
|
||||
};
|
||||
use core::result;
|
||||
use derivative::Derivative;
|
||||
use parity_scale_codec::{self, Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -53,11 +53,7 @@
|
||||
use super::v1::{Order as OldOrder, Response as OldResponse, Xcm as OldXcm};
|
||||
use crate::{DoubleEncoded, GetWeight};
|
||||
use alloc::{vec, vec::Vec};
|
||||
use core::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt::Debug,
|
||||
result,
|
||||
};
|
||||
use core::{fmt::Debug, result};
|
||||
use derivative::Derivative;
|
||||
use parity_scale_codec::{self, Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
use frame_support::traits::Get;
|
||||
use sp_runtime::traits::CheckedConversion;
|
||||
use sp_std::{convert::TryFrom, marker::PhantomData};
|
||||
use sp_std::marker::PhantomData;
|
||||
use xcm::latest::{
|
||||
AssetId::{Abstract, Concrete},
|
||||
Fungibility::Fungible,
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
use frame_support::traits::{EnsureOrigin, Get, GetBacking, OriginTrait};
|
||||
use frame_system::RawOrigin as SystemRawOrigin;
|
||||
use polkadot_parachain::primitives::IsSystem;
|
||||
use sp_std::{convert::TryInto, marker::PhantomData};
|
||||
use sp_std::marker::PhantomData;
|
||||
use xcm::latest::{BodyId, BodyPart, Junction, Junctions::*, MultiLocation, NetworkId, OriginKind};
|
||||
use xcm_executor::traits::{Convert, ConvertOrigin};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ use frame_support::{
|
||||
};
|
||||
use parity_scale_codec::Decode;
|
||||
use sp_runtime::traits::{SaturatedConversion, Saturating, Zero};
|
||||
use sp_std::{convert::TryInto, marker::PhantomData, result::Result};
|
||||
use sp_std::{marker::PhantomData, result::Result};
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_executor::{
|
||||
traits::{WeightBounds, WeightTrader},
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use sp_std::{borrow::Borrow, convert::TryFrom, prelude::*, result::Result};
|
||||
use sp_std::{borrow::Borrow, prelude::*, result::Result};
|
||||
use xcm::latest::{MultiLocation, OriginKind};
|
||||
|
||||
/// Generic third-party conversion trait. Use this when you don't want to force the user to use default
|
||||
|
||||
@@ -28,7 +28,7 @@ use sp_runtime::{
|
||||
traits::{Hash, IdentityLookup},
|
||||
AccountId32,
|
||||
};
|
||||
use sp_std::{convert::TryFrom, prelude::*};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use polkadot_core_primitives::BlockNumber as RelayBlockNumber;
|
||||
|
||||
@@ -28,7 +28,7 @@ use sp_runtime::{
|
||||
traits::{Hash, IdentityLookup},
|
||||
AccountId32,
|
||||
};
|
||||
use sp_std::{convert::TryFrom, prelude::*};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use polkadot_core_primitives::BlockNumber as RelayBlockNumber;
|
||||
|
||||
Reference in New Issue
Block a user