Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions bridges/bin/runtime-common/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/messages/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/runtime/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion bridges/primitives/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion bridges/primitives/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
2 changes: 0 additions & 2 deletions bridges/relays/bin-substrate/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion bridges/relays/bin-substrate/src/cli/reinit_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/client-substrate/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/lib-substrate-relay/src/messages_lane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/lib-substrate-relay/src/messages_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/lib-substrate-relay/src/messages_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> =
Expand Down
2 changes: 1 addition & 1 deletion cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 0 additions & 2 deletions erasure-coding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion node/core/approval-voting/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
5 changes: 1 addition & 4 deletions node/core/approval-voting/src/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
1 change: 0 additions & 1 deletion node/core/av-store/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions node/core/av-store/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

use super::*;

use std::convert::TryFrom;

use assert_matches::assert_matches;
use futures::{channel::oneshot, executor, future, Future};

Expand Down
1 change: 0 additions & 1 deletion node/core/backing/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![
Expand Down
1 change: 0 additions & 1 deletion node/core/provisioner/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion node/metrics/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion node/network/availability-distribution/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion node/network/availability-recovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

use std::{
collections::{HashMap, VecDeque},
convert::TryFrom,
pin::Pin,
time::Duration,
};
Expand Down
2 changes: 1 addition & 1 deletion node/network/availability-recovery/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 0 additions & 1 deletion node/network/protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions node/primitives/src/disputes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion node/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion node/subsystem-types/src/messages/network_bridge_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
1 change: 0 additions & 1 deletion node/subsystem-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions primitives/src/v2/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions runtime/common/slot_range_helper/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/crowdloan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/paras/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
4 changes: 1 addition & 3 deletions runtime/parachains/src/ump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
2 changes: 1 addition & 1 deletion runtime/rococo/src/bridge_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
1 change: 0 additions & 1 deletion runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down
2 changes: 1 addition & 1 deletion tests/purge_chain_works.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/running_the_node_and_interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion utils/remote-ext-tests/bags-list/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
Loading