mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +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:
@@ -42,10 +42,7 @@ use sp_runtime::{
|
||||
traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedDiv, CheckedMul, Saturating, Zero},
|
||||
FixedPointNumber, FixedPointOperand, FixedU128,
|
||||
};
|
||||
use sp_std::{
|
||||
cmp::PartialOrd, convert::TryFrom, fmt::Debug, marker::PhantomData, ops::RangeInclusive,
|
||||
vec::Vec,
|
||||
};
|
||||
use sp_std::{cmp::PartialOrd, fmt::Debug, marker::PhantomData, ops::RangeInclusive, vec::Vec};
|
||||
use sp_trie::StorageProof;
|
||||
|
||||
/// Bidirectional message bridge.
|
||||
|
||||
@@ -45,7 +45,7 @@ use frame_support::{ensure, fail};
|
||||
use frame_system::{ensure_signed, RawOrigin};
|
||||
use sp_finality_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID};
|
||||
use sp_runtime::traits::{BadOrigin, Header as HeaderT, Zero};
|
||||
use sp_std::{boxed::Box, convert::TryInto};
|
||||
use sp_std::boxed::Box;
|
||||
|
||||
#[cfg(test)]
|
||||
mod mock;
|
||||
|
||||
@@ -30,7 +30,7 @@ use bp_runtime::messages::DispatchFeePayment;
|
||||
use frame_benchmarking::{account, benchmarks_instance_pallet};
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use frame_system::RawOrigin;
|
||||
use sp_std::{collections::vec_deque::VecDeque, convert::TryInto, ops::RangeInclusive, prelude::*};
|
||||
use sp_std::{collections::vec_deque::VecDeque, ops::RangeInclusive, prelude::*};
|
||||
|
||||
const SEED: u32 = 0;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ use sp_runtime::{
|
||||
},
|
||||
FixedPointOperand,
|
||||
};
|
||||
use sp_std::{convert::TryFrom, fmt::Debug, hash::Hash, str::FromStr, vec, vec::Vec};
|
||||
use sp_std::{fmt::Debug, hash::Hash, str::FromStr, vec, vec::Vec};
|
||||
|
||||
/// Chain call, that is either SCALE-encoded, or decoded.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
||||
@@ -22,7 +22,7 @@ use codec::Encode;
|
||||
use frame_support::{RuntimeDebug, StorageHasher};
|
||||
use sp_core::{hash::H256, storage::StorageKey};
|
||||
use sp_io::hashing::blake2_256;
|
||||
use sp_std::{convert::TryFrom, vec, vec::Vec};
|
||||
use sp_std::{vec, vec::Vec};
|
||||
|
||||
pub use chain::{
|
||||
AccountIdOf, AccountPublicOf, BalanceOf, BlockNumberOf, Chain, EncodedOrDecodedCall, HashOf,
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
use bp_header_chain::justification::GrandpaJustification;
|
||||
use codec::Encode;
|
||||
use sp_application_crypto::TryFrom;
|
||||
use sp_finality_grandpa::{AuthorityId, AuthoritySignature, AuthorityWeight, SetId};
|
||||
use sp_runtime::traits::{Header as HeaderT, One, Zero};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
//! Deal with CLI args of substrate-to-substrate relay.
|
||||
|
||||
use std::convert::TryInto;
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
use relay_substrate_client::ChainRuntimeVersion;
|
||||
use sp_runtime::app_crypto::Ss58Codec;
|
||||
|
||||
@@ -36,7 +36,6 @@ use relay_substrate_client::{
|
||||
SyncHeader, TransactionEra, TransactionSignScheme, UnsignedTransaction,
|
||||
};
|
||||
use sp_core::{Bytes, Pair};
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
use structopt::StructOpt;
|
||||
use strum::{EnumString, EnumVariantNames, VariantNames};
|
||||
use substrate_relay_helper::{
|
||||
|
||||
@@ -47,7 +47,7 @@ use sp_runtime::{
|
||||
};
|
||||
use sp_trie::StorageProof;
|
||||
use sp_version::RuntimeVersion;
|
||||
use std::{convert::TryFrom, future::Future};
|
||||
use std::future::Future;
|
||||
|
||||
const SUB_API_GRANDPA_AUTHORITIES: &str = "GrandpaApi_grandpa_authorities";
|
||||
const SUB_API_TXPOOL_VALIDATE_TRANSACTION: &str = "TaggedTransactionQueue_validate_transaction";
|
||||
|
||||
@@ -40,7 +40,7 @@ use relay_substrate_client::{
|
||||
};
|
||||
use relay_utils::metrics::MetricsParams;
|
||||
use sp_core::Pair;
|
||||
use std::{convert::TryFrom, fmt::Debug, marker::PhantomData};
|
||||
use std::{fmt::Debug, marker::PhantomData};
|
||||
|
||||
/// Substrate -> Substrate messages synchronization pipeline.
|
||||
pub trait SubstrateMessageLane: 'static + Clone + Debug + Send + Sync {
|
||||
|
||||
@@ -32,7 +32,7 @@ use relay_utils::metrics::{
|
||||
};
|
||||
use sp_core::storage::StorageData;
|
||||
use sp_runtime::{FixedPointNumber, FixedU128};
|
||||
use std::{convert::TryFrom, fmt::Debug, marker::PhantomData};
|
||||
use std::{fmt::Debug, marker::PhantomData};
|
||||
|
||||
/// Name of the `NextFeeMultiplier` storage value within the transaction payment pallet.
|
||||
const NEXT_FEE_MULTIPLIER_VALUE_NAME: &str = "NextFeeMultiplier";
|
||||
|
||||
@@ -49,7 +49,7 @@ use relay_substrate_client::{
|
||||
use relay_utils::{relay_loop::Client as RelayClient, HeaderId};
|
||||
use sp_core::{Bytes, Pair};
|
||||
use sp_runtime::{traits::Saturating, FixedPointNumber, FixedU128};
|
||||
use std::{collections::VecDeque, convert::TryFrom, ops::RangeInclusive};
|
||||
use std::{collections::VecDeque, ops::RangeInclusive};
|
||||
|
||||
/// Message receiving proof returned by the target Substrate node.
|
||||
pub type SubstrateMessagesDeliveryProof<C> =
|
||||
|
||||
@@ -25,7 +25,7 @@ use std::net::ToSocketAddrs;
|
||||
pub use crate::{error::Error, service::BlockId};
|
||||
pub use polkadot_performance_test::PerfCheckError;
|
||||
|
||||
impl std::convert::From<String> for Error {
|
||||
impl From<String> for Error {
|
||||
fn from(s: String) -> Self {
|
||||
Self::Other(s)
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
//! f is the maximum number of faulty validators in the system.
|
||||
//! The data is coded so any f+1 chunks can be used to reconstruct the full data.
|
||||
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use polkadot_node_primitives::{AvailableData, Proof};
|
||||
use polkadot_primitives::v2::{BlakeTwo256, Hash as H256, HashT};
|
||||
|
||||
@@ -54,7 +54,7 @@ use sp_consensus_slots::Slot;
|
||||
use bitvec::order::Lsb0 as BitOrderLsb0;
|
||||
use futures::{channel::oneshot, prelude::*};
|
||||
|
||||
use std::{collections::HashMap, convert::TryFrom};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use super::approval_db::v1;
|
||||
use crate::{
|
||||
|
||||
@@ -22,10 +22,7 @@ use polkadot_node_subsystem::SubsystemResult;
|
||||
use bitvec::order::Lsb0 as BitOrderLsb0;
|
||||
use polkadot_primitives::v2::{BlockNumber, CandidateHash, CandidateReceipt, GroupIndex, Hash};
|
||||
|
||||
use std::{
|
||||
collections::{hash_map::Entry, BTreeMap, HashMap},
|
||||
convert::Into,
|
||||
};
|
||||
use std::collections::{hash_map::Entry, BTreeMap, HashMap};
|
||||
|
||||
use super::{
|
||||
approval_db::v1::{OurAssignment, StoredBlockRange},
|
||||
|
||||
@@ -35,7 +35,6 @@ pub struct Metrics(Option<MetricsInner>);
|
||||
impl Metrics {
|
||||
pub(crate) fn on_chunks_received(&self, count: usize) {
|
||||
if let Some(metrics) = &self.0 {
|
||||
use core::convert::TryFrom as _;
|
||||
// assume usize fits into u64
|
||||
let by = u64::try_from(count).unwrap_or_default();
|
||||
metrics.received_availability_chunks_total.inc_by(by);
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
use super::*;
|
||||
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use assert_matches::assert_matches;
|
||||
use futures::{channel::oneshot, executor, future, Future};
|
||||
|
||||
|
||||
@@ -1456,7 +1456,6 @@ fn validation_work_ignores_wrong_collator() {
|
||||
#[test]
|
||||
fn candidate_backing_reorders_votes() {
|
||||
use sp_core::Encode;
|
||||
use std::convert::TryFrom;
|
||||
|
||||
let para_id = ParaId::from(10);
|
||||
let validators = vec![
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use polkadot_node_subsystem_util::metrics::{self, prometheus};
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[derive(Clone)]
|
||||
struct MetricsInner {
|
||||
|
||||
@@ -21,7 +21,7 @@ use polkadot_test_service::{node_config, run_validator_node, test_prometheus_con
|
||||
use primitives::v2::metric_definitions::PARACHAIN_INHERENT_DATA_BITFIELDS_PROCESSED;
|
||||
use sc_client_api::{execution_extensions::ExecutionStrategies, ExecutionStrategy};
|
||||
use sp_keyring::AccountKeyring::*;
|
||||
use std::{collections::HashMap, convert::TryFrom};
|
||||
use std::collections::HashMap;
|
||||
|
||||
const DEFAULT_PROMETHEUS_PORT: u16 = 9616;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::{collections::HashMap, convert::TryFrom};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use parity_scale_codec::Encode;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//! Helper functions and tools to generate mock data useful for testing this subsystem.
|
||||
|
||||
use std::{convert::TryFrom, sync::Arc};
|
||||
use std::sync::Arc;
|
||||
|
||||
use sp_keyring::Sr25519Keyring;
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
use std::{
|
||||
collections::{HashMap, VecDeque},
|
||||
convert::TryFrom,
|
||||
pin::Pin,
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::{convert::TryFrom, sync::Arc, time::Duration};
|
||||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
use assert_matches::assert_matches;
|
||||
use futures::{executor, future};
|
||||
|
||||
@@ -282,7 +282,6 @@ impl View {
|
||||
/// v1 protocol types.
|
||||
pub mod v1 {
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
use polkadot_primitives::v2::{
|
||||
CandidateHash, CandidateIndex, CollatorId, CollatorSignature, CompactStatement, Hash,
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::convert::TryInto;
|
||||
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
|
||||
use sp_application_crypto::AppKey;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#![deny(missing_docs)]
|
||||
|
||||
use std::{convert::TryFrom, pin::Pin, time::Duration};
|
||||
use std::{pin::Pin, time::Duration};
|
||||
|
||||
use bounded_vec::BoundedVec;
|
||||
use futures::Future;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::{collections::HashSet, convert::TryFrom};
|
||||
use std::collections::HashSet;
|
||||
|
||||
pub use sc_network::{PeerId, ReputationChange};
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ use sp_core::{traits::SpawnNamed, ByteArray};
|
||||
use sp_keystore::{CryptoStore, Error as KeystoreError, SyncCryptoStorePtr};
|
||||
use std::{
|
||||
collections::{hash_map::Entry, HashMap},
|
||||
convert::TryFrom,
|
||||
fmt,
|
||||
marker::Unpin,
|
||||
pin::Pin,
|
||||
|
||||
@@ -21,8 +21,6 @@ use scale_info::TypeInfo;
|
||||
use application_crypto::AppKey;
|
||||
#[cfg(feature = "std")]
|
||||
use sp_keystore::{CryptoStore, Error as KeystoreError, SyncCryptoStorePtr};
|
||||
#[cfg(feature = "std")]
|
||||
use sp_std::convert::TryInto;
|
||||
use sp_std::prelude::Vec;
|
||||
|
||||
use primitives::RuntimeDebug;
|
||||
|
||||
@@ -22,7 +22,7 @@ pub use enumn::N;
|
||||
pub use parity_scale_codec::{Decode, Encode};
|
||||
pub use paste;
|
||||
pub use sp_runtime::traits::CheckedSub;
|
||||
pub use sp_std::{convert::TryInto, ops::Add, result};
|
||||
pub use sp_std::{ops::Add, result};
|
||||
|
||||
/// This macro generates a `SlotRange` enum of arbitrary length for use in the Slot Auction
|
||||
/// mechanism on Polkadot.
|
||||
@@ -168,7 +168,7 @@ macro_rules! generate_slot_range_new_bounded {
|
||||
///
|
||||
/// For example: `SlotRange::new_bounded(1, 2, 3) == SlotRange::OneTwo`.
|
||||
pub fn new_bounded<
|
||||
Index: $crate::Add<Output=Index> + $crate::CheckedSub + Copy + Ord + From<u32> + $crate::TryInto<u32>
|
||||
Index: $crate::Add<Output=Index> + $crate::CheckedSub + Copy + Ord + From<u32> + TryInto<u32>
|
||||
>(
|
||||
current: Index,
|
||||
first: Index,
|
||||
|
||||
@@ -826,7 +826,7 @@ mod crypto {
|
||||
use sp_core::ed25519;
|
||||
use sp_io::crypto::{ed25519_generate, ed25519_sign};
|
||||
use sp_runtime::{MultiSignature, MultiSigner};
|
||||
use sp_std::{convert::TryFrom, vec::Vec};
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
pub fn create_ed25519_pubkey(seed: Vec<u8>) -> MultiSigner {
|
||||
ed25519_generate(0.into(), Some(seed)).into()
|
||||
|
||||
@@ -44,7 +44,7 @@ use sp_runtime::{
|
||||
transaction_validity::TransactionPriority,
|
||||
AccountId32,
|
||||
};
|
||||
use sp_std::{convert::TryInto, sync::Arc};
|
||||
use sp_std::sync::Arc;
|
||||
|
||||
type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
|
||||
type Block = frame_system::mocking::MockBlock<Test>;
|
||||
|
||||
@@ -35,7 +35,7 @@ use sp_runtime::{
|
||||
traits::{Header as HeaderT, One, TrailingZeroInput, Zero},
|
||||
RuntimeAppPublic,
|
||||
};
|
||||
use sp_std::{collections::btree_map::BTreeMap, convert::TryInto, prelude::Vec, vec};
|
||||
use sp_std::{collections::btree_map::BTreeMap, prelude::Vec, vec};
|
||||
|
||||
fn mock_validation_code() -> ValidationCode {
|
||||
ValidationCode(vec![1, 2, 3])
|
||||
|
||||
@@ -121,7 +121,7 @@ use sp_runtime::{
|
||||
traits::{AppVerify, One},
|
||||
DispatchResult, SaturatedConversion,
|
||||
};
|
||||
use sp_std::{cmp, convert::TryInto, mem, prelude::*};
|
||||
use sp_std::{cmp, mem, prelude::*};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -42,7 +42,7 @@ use primitives::v2::{
|
||||
};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime::traits::{One, Saturating};
|
||||
use sp_std::{convert::TryInto, prelude::*};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
use crate::{configuration, initializer::SessionChangeNotification, paras};
|
||||
|
||||
|
||||
@@ -21,9 +21,7 @@ use crate::{
|
||||
use frame_support::{pallet_prelude::*, traits::EnsureOrigin};
|
||||
use frame_system::pallet_prelude::*;
|
||||
use primitives::v2::{Id as ParaId, UpwardMessage};
|
||||
use sp_std::{
|
||||
collections::btree_map::BTreeMap, convert::TryFrom, fmt, marker::PhantomData, mem, prelude::*,
|
||||
};
|
||||
use sp_std::{collections::btree_map::BTreeMap, fmt, marker::PhantomData, mem, prelude::*};
|
||||
use xcm::latest::Outcome;
|
||||
|
||||
pub use pallet::*;
|
||||
|
||||
@@ -39,7 +39,7 @@ use frame_support::{
|
||||
};
|
||||
use rococo_runtime_constants::fee::WeightToFee;
|
||||
use sp_runtime::FixedU128;
|
||||
use sp_std::{convert::TryFrom, marker::PhantomData, ops::RangeInclusive};
|
||||
use sp_std::{marker::PhantomData, ops::RangeInclusive};
|
||||
|
||||
/// Maximal number of pending outbound messages.
|
||||
const MAXIMAL_PENDING_MESSAGES_AT_OUTBOUND_LANE: MessageNonce =
|
||||
|
||||
@@ -850,7 +850,6 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
|
||||
fn candidate_events() -> Vec<CandidateEvent<Hash>> {
|
||||
use core::convert::TryInto;
|
||||
runtime_impl::candidate_events::<Runtime, _>(|trait_event| trait_event.try_into().ok())
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
use std::{convert::TryInto, process::Command, time::Duration};
|
||||
use std::{process::Command, time::Duration};
|
||||
use tempfile::tempdir;
|
||||
|
||||
pub mod common;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use assert_cmd::cargo::cargo_bin;
|
||||
use std::{convert::TryInto, process::Command, time::Duration};
|
||||
use std::{process::Command, time::Duration};
|
||||
use tempfile::tempdir;
|
||||
|
||||
pub mod common;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
//! Remote tests for bags-list pallet.
|
||||
|
||||
use clap::{ArgEnum, Parser};
|
||||
use std::convert::TryInto;
|
||||
|
||||
#[derive(Clone, Debug, ArgEnum)]
|
||||
#[clap(rename_all = "PascalCase")]
|
||||
|
||||
@@ -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