mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 04:11:07 +00:00
Remove useless imports (#11136)
Because `TryInto`/`TryFrom` are in prelude by default from edition 2021 Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -562,7 +562,7 @@ mod tests {
|
||||
RuntimeAppPublic,
|
||||
};
|
||||
use sp_timestamp;
|
||||
use std::{borrow::Cow, convert::TryInto, sync::Arc};
|
||||
use std::{borrow::Cow, sync::Arc};
|
||||
|
||||
type AccountPublic = <Signature as Verify>::Signer;
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ use nix::{
|
||||
use node_primitives::Block;
|
||||
use remote_externalities::rpc_api;
|
||||
use std::{
|
||||
convert::TryInto,
|
||||
ops::{Deref, DerefMut},
|
||||
path::Path,
|
||||
process::{Child, Command, ExitStatus},
|
||||
|
||||
@@ -25,10 +25,7 @@ use nix::{
|
||||
},
|
||||
unistd::Pid,
|
||||
};
|
||||
use std::{
|
||||
convert::TryInto,
|
||||
process::{Child, Command},
|
||||
};
|
||||
use std::process::{Child, Command};
|
||||
use tempfile::tempdir;
|
||||
|
||||
pub mod common;
|
||||
|
||||
@@ -21,7 +21,7 @@ use nix::{
|
||||
sys::signal::{kill, Signal::SIGINT},
|
||||
unistd::Pid,
|
||||
};
|
||||
use std::{convert::TryInto, process};
|
||||
use std::process;
|
||||
|
||||
pub mod common;
|
||||
pub mod websocket_server;
|
||||
|
||||
@@ -25,7 +25,6 @@ use nix::{
|
||||
};
|
||||
use regex::Regex;
|
||||
use std::{
|
||||
convert::TryInto,
|
||||
io::Read,
|
||||
path::PathBuf,
|
||||
process::{Command, Stdio},
|
||||
|
||||
@@ -71,7 +71,6 @@ use crate::Error;
|
||||
pub use sp_core::MAX_POSSIBLE_ALLOCATION;
|
||||
use sp_wasm_interface::{Pointer, WordSize};
|
||||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
mem,
|
||||
ops::{Index, IndexMut, Range},
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ use sp_runtime::{
|
||||
traits::{Block as BlockT, NumberFor},
|
||||
Justifications,
|
||||
};
|
||||
use std::{collections::HashSet, convert::TryFrom, fmt, sync::Arc};
|
||||
use std::{collections::HashSet, fmt, sync::Arc};
|
||||
|
||||
use crate::{blockchain::Info, notifications::StorageEventStream, FinalizeSummary, ImportSummary};
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ use crate::{
|
||||
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
convert::TryInto,
|
||||
marker::PhantomData,
|
||||
sync::Arc,
|
||||
time::Duration,
|
||||
@@ -581,14 +580,11 @@ where
|
||||
.authorities(&id)
|
||||
.map_err(|e| Error::CallingRuntime(e.into()))?
|
||||
.into_iter()
|
||||
.map(std::convert::Into::into)
|
||||
.map(Into::into)
|
||||
.collect::<HashSet<_>>();
|
||||
|
||||
let intersection = local_pub_keys
|
||||
.intersection(&authorities)
|
||||
.cloned()
|
||||
.map(std::convert::Into::into)
|
||||
.collect();
|
||||
let intersection =
|
||||
local_pub_keys.intersection(&authorities).cloned().map(Into::into).collect();
|
||||
|
||||
Ok(intersection)
|
||||
}
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::convert::{From, TryInto};
|
||||
|
||||
use sp_application_crypto::RuntimeAppPublic;
|
||||
use sp_core::keccak_256;
|
||||
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
|
||||
|
||||
@@ -25,7 +25,7 @@ use sc_keystore::LocalKeystore;
|
||||
use sc_service::config::{BasePath, KeystoreConfig};
|
||||
use sp_core::crypto::{KeyTypeId, SecretString};
|
||||
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
|
||||
use std::{convert::TryFrom, sync::Arc};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// The `insert` command
|
||||
#[derive(Debug, Clone, Parser)]
|
||||
|
||||
@@ -31,7 +31,7 @@ use sp_core::{
|
||||
Pair,
|
||||
};
|
||||
use sp_runtime::{traits::IdentifyAccount, MultiSigner};
|
||||
use std::{convert::TryFrom, io::Read, path::PathBuf};
|
||||
use std::{io::Read, path::PathBuf};
|
||||
|
||||
/// Public key type for Runtime
|
||||
pub type PublicFor<P> = <P as sp_core::Pair>::Public;
|
||||
|
||||
@@ -66,7 +66,7 @@ impl VerifyCmd {
|
||||
fn verify<Pair>(sig_data: Vec<u8>, message: Vec<u8>, uri: &str) -> error::Result<()>
|
||||
where
|
||||
Pair: sp_core::Pair,
|
||||
Pair::Signature: for<'a> std::convert::TryFrom<&'a [u8]>,
|
||||
Pair::Signature: for<'a> TryFrom<&'a [u8]>,
|
||||
{
|
||||
let signature =
|
||||
Pair::Signature::try_from(&sig_data).map_err(|_| error::Error::SignatureFormatInvalid)?;
|
||||
|
||||
@@ -80,19 +80,19 @@ pub enum Error {
|
||||
GlobalLoggerError(#[from] sc_tracing::logging::Error),
|
||||
}
|
||||
|
||||
impl std::convert::From<&str> for Error {
|
||||
impl From<&str> for Error {
|
||||
fn from(s: &str) -> Error {
|
||||
Error::Input(s.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::From<String> for Error {
|
||||
impl From<String> for Error {
|
||||
fn from(s: String) -> Error {
|
||||
Error::Input(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::From<crypto::PublicError> for Error {
|
||||
impl From<crypto::PublicError> for Error {
|
||||
fn from(e: crypto::PublicError) -> Error {
|
||||
Error::InvalidUri(e)
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ use sp_runtime::{
|
||||
generic::BlockId,
|
||||
traits::{Block as BlockT, NumberFor},
|
||||
};
|
||||
use std::{convert::TryFrom, fmt::Debug, str::FromStr};
|
||||
use std::{fmt::Debug, str::FromStr};
|
||||
|
||||
pub use crate::params::{
|
||||
database_params::*, import_params::*, keystore_params::*, network_params::*,
|
||||
|
||||
@@ -30,14 +30,7 @@
|
||||
//!
|
||||
//! NOTE: Aura itself is designed to be generic over the crypto used.
|
||||
#![forbid(missing_docs, unsafe_code)]
|
||||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt::Debug,
|
||||
hash::Hash,
|
||||
marker::PhantomData,
|
||||
pin::Pin,
|
||||
sync::Arc,
|
||||
};
|
||||
use std::{fmt::Debug, hash::Hash, marker::PhantomData, pin::Pin, sync::Arc};
|
||||
|
||||
use futures::prelude::*;
|
||||
use log::{debug, trace};
|
||||
@@ -517,7 +510,7 @@ pub enum Error<B: BlockT> {
|
||||
Inherent(sp_inherents::Error),
|
||||
}
|
||||
|
||||
impl<B: BlockT> std::convert::From<Error<B>> for String {
|
||||
impl<B: BlockT> From<Error<B>> for String {
|
||||
fn from(error: Error<B>) -> String {
|
||||
error.to_string()
|
||||
}
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
collections::{HashMap, HashSet},
|
||||
convert::TryInto,
|
||||
future::Future,
|
||||
pin::Pin,
|
||||
sync::Arc,
|
||||
@@ -320,7 +319,7 @@ pub enum Error<B: BlockT> {
|
||||
ForkTree(Box<fork_tree::Error<sp_blockchain::Error>>),
|
||||
}
|
||||
|
||||
impl<B: BlockT> std::convert::From<Error<B>> for String {
|
||||
impl<B: BlockT> From<Error<B>> for String {
|
||||
fn from(error: Error<B>) -> String {
|
||||
error.to_string()
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ impl Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::From<Error> for jsonrpc_core::Error {
|
||||
impl From<Error> for jsonrpc_core::Error {
|
||||
fn from(error: Error) -> Self {
|
||||
jsonrpc_core::Error {
|
||||
code: jsonrpc_core::ErrorCode::ServerError(error.to_code()),
|
||||
|
||||
@@ -119,13 +119,13 @@ pub enum Error<B: BlockT> {
|
||||
Other(String),
|
||||
}
|
||||
|
||||
impl<B: BlockT> std::convert::From<Error<B>> for String {
|
||||
impl<B: BlockT> From<Error<B>> for String {
|
||||
fn from(error: Error<B>) -> String {
|
||||
error.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
impl<B: BlockT> std::convert::From<Error<B>> for ConsensusError {
|
||||
impl<B: BlockT> From<Error<B>> for ConsensusError {
|
||||
fn from(error: Error<B>) -> ConsensusError {
|
||||
ConsensusError::ClientImport(error.to_string())
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
//! Db-based backend utility structures and functions, used by both
|
||||
//! full and light storages.
|
||||
|
||||
use std::{convert::TryInto, fmt, fs, io, path::Path, sync::Arc};
|
||||
use std::{fmt, fs, io, path::Path, sync::Arc};
|
||||
|
||||
use log::{debug, info};
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ use crate::{
|
||||
use codec::{Decode, Encode};
|
||||
use sp_core::sandbox::HostError;
|
||||
use sp_wasm_interface::{FunctionContext, Pointer, ReturnValue, Value, WordSize};
|
||||
use std::{cell::RefCell, collections::HashMap, convert::TryInto, rc::Rc};
|
||||
use std::{cell::RefCell, collections::HashMap, rc::Rc};
|
||||
use wasmer::RuntimeError;
|
||||
|
||||
use crate::sandbox::{
|
||||
|
||||
@@ -171,7 +171,7 @@ where
|
||||
mod tests {
|
||||
use super::*;
|
||||
use jsonrpc_core::{types::Params, Notification, Output};
|
||||
use std::{collections::HashSet, convert::TryInto, sync::Arc};
|
||||
use std::{collections::HashSet, sync::Arc};
|
||||
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use sc_block_builder::{BlockBuilder, RecordProof};
|
||||
|
||||
@@ -22,11 +22,7 @@ use log::info;
|
||||
use sc_client_api::ClientInfo;
|
||||
use sc_network::{NetworkStatus, SyncState, WarpSyncPhase, WarpSyncProgress};
|
||||
use sp_runtime::traits::{Block as BlockT, CheckedDiv, NumberFor, Saturating, Zero};
|
||||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt,
|
||||
time::Instant,
|
||||
};
|
||||
use std::{fmt, time::Instant};
|
||||
|
||||
/// State of the informant display system.
|
||||
///
|
||||
|
||||
@@ -303,7 +303,6 @@ mod tests {
|
||||
use sp_runtime::{testing::H256, traits::Block as BlockT};
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
convert::TryInto,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
use substrate_test_runtime_client::runtime::Block;
|
||||
|
||||
@@ -50,7 +50,6 @@ use sp_runtime::traits::Block as BlockT;
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
collections::HashMap,
|
||||
convert::TryFrom,
|
||||
error::Error,
|
||||
fs,
|
||||
future::Future,
|
||||
|
||||
@@ -60,7 +60,6 @@ use sp_runtime::{
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
collections::{HashMap, HashSet, VecDeque},
|
||||
convert::TryFrom as _,
|
||||
io, iter,
|
||||
num::NonZeroUsize,
|
||||
pin::Pin,
|
||||
|
||||
@@ -41,7 +41,7 @@ use libp2p::core::{upgrade, InboundUpgrade, OutboundUpgrade, UpgradeInfo};
|
||||
use log::{error, warn};
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
convert::{Infallible, TryFrom as _},
|
||||
convert::Infallible,
|
||||
io, mem,
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
|
||||
@@ -56,7 +56,6 @@ use libp2p::{
|
||||
use std::{
|
||||
borrow::Cow,
|
||||
collections::{hash_map::Entry, HashMap},
|
||||
convert::TryFrom as _,
|
||||
io, iter,
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
|
||||
@@ -73,7 +73,6 @@ use std::{
|
||||
borrow::Cow,
|
||||
cmp,
|
||||
collections::{HashMap, HashSet},
|
||||
convert::TryFrom as _,
|
||||
fs, iter,
|
||||
marker::PhantomData,
|
||||
num::NonZeroUsize,
|
||||
|
||||
@@ -38,7 +38,6 @@ use parking_lot::Mutex;
|
||||
use prometheus_endpoint::{register, CounterVec, GaugeVec, Opts, PrometheusError, Registry, U64};
|
||||
use std::{
|
||||
cell::RefCell,
|
||||
convert::TryFrom as _,
|
||||
fmt,
|
||||
pin::Pin,
|
||||
sync::Arc,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::{collections::HashSet, convert::TryFrom, str::FromStr, sync::Arc, thread::sleep};
|
||||
use std::{collections::HashSet, str::FromStr, sync::Arc, thread::sleep};
|
||||
|
||||
use crate::NetworkProvider;
|
||||
use codec::{Decode, Encode};
|
||||
@@ -327,10 +327,7 @@ mod tests {
|
||||
use sc_client_db::offchain::LocalStorage;
|
||||
use sc_network::{NetworkStateInfo, PeerId};
|
||||
use sp_core::offchain::{DbExternalities, Externalities};
|
||||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
time::SystemTime,
|
||||
};
|
||||
use std::time::SystemTime;
|
||||
|
||||
pub(super) struct TestNetwork();
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ use once_cell::sync::Lazy;
|
||||
use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender};
|
||||
use sp_core::offchain::{HttpError, HttpRequestId, HttpRequestStatus, Timestamp};
|
||||
use std::{
|
||||
convert::TryFrom,
|
||||
fmt,
|
||||
io::Read as _,
|
||||
pin::Pin,
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
//! Helper methods dedicated to timestamps.
|
||||
|
||||
use sp_core::offchain::Timestamp;
|
||||
use std::{
|
||||
convert::TryInto,
|
||||
time::{Duration, SystemTime},
|
||||
};
|
||||
use std::time::{Duration, SystemTime};
|
||||
|
||||
/// Returns the current time as a `Timestamp`.
|
||||
pub fn now() -> Timestamp {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use std::{convert::TryInto, sync::Arc};
|
||||
use std::sync::Arc;
|
||||
|
||||
use sp_blockchain::HeaderBackend;
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ use sp_runtime::{
|
||||
},
|
||||
};
|
||||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
io::Read,
|
||||
pin::Pin,
|
||||
task::Poll,
|
||||
|
||||
@@ -294,7 +294,7 @@ impl BasePath {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::From<PathBuf> for BasePath {
|
||||
impl From<PathBuf> for BasePath {
|
||||
fn from(path: PathBuf) -> Self {
|
||||
BasePath::new(path)
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use std::{convert::TryFrom, time::SystemTime};
|
||||
use std::time::SystemTime;
|
||||
|
||||
use crate::config::Configuration;
|
||||
use futures_timer::Delay;
|
||||
|
||||
@@ -40,7 +40,6 @@ pub use graph::{base_pool::Limit as PoolLimit, ChainApi, Options, Pool, Transact
|
||||
use parking_lot::Mutex;
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
convert::TryInto,
|
||||
pin::Pin,
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ use sp_runtime::{
|
||||
traits::Block as _,
|
||||
transaction_validity::{InvalidTransaction, TransactionSource, ValidTransaction},
|
||||
};
|
||||
use std::{collections::BTreeSet, convert::TryInto, sync::Arc};
|
||||
use std::{collections::BTreeSet, sync::Arc};
|
||||
use substrate_test_runtime_client::{
|
||||
runtime::{Block, Extrinsic, Hash, Header, Index, Transfer},
|
||||
AccountKeyring::*,
|
||||
@@ -864,8 +864,6 @@ fn ready_set_should_eventually_resolve_when_block_update_arrives() {
|
||||
|
||||
#[test]
|
||||
fn should_not_accept_old_signatures() {
|
||||
use std::convert::TryFrom;
|
||||
|
||||
let client = Arc::new(substrate_test_runtime_client::new());
|
||||
|
||||
let pool = Arc::new(
|
||||
|
||||
@@ -147,7 +147,7 @@ use sp_runtime::{
|
||||
},
|
||||
ArithmeticError, TokenError,
|
||||
};
|
||||
use sp_std::{borrow::Borrow, convert::TryInto, prelude::*};
|
||||
use sp_std::{borrow::Borrow, prelude::*};
|
||||
|
||||
use frame_support::{
|
||||
dispatch::{DispatchError, DispatchResult},
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
use frame_election_provider_support::{SortedListProvider, VoteWeight};
|
||||
use honggfuzz::fuzz;
|
||||
use pallet_bags_list::mock::{AccountId, BagsList, ExtBuilder};
|
||||
use std::convert::From;
|
||||
|
||||
const ID_RANGE: AccountId = 25_000;
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ use frame_support::{
|
||||
};
|
||||
use remote_externalities::{Builder, Mode, OnlineConfig};
|
||||
use sp_runtime::{traits::Block as BlockT, DeserializeOwned};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
/// Execute the sanity check of the bags-list.
|
||||
pub async fn execute<Runtime: crate::RuntimeT, Block: BlockT + DeserializeOwned>(
|
||||
|
||||
@@ -96,7 +96,6 @@ pub mod test_utils {
|
||||
}
|
||||
macro_rules! assert_return_code {
|
||||
( $x:expr , $y:expr $(,)? ) => {{
|
||||
use sp_std::convert::TryInto;
|
||||
assert_eq!(u32::from_le_bytes($x.data[..].try_into().unwrap()), $y as u32);
|
||||
}};
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ use sp_runtime::{
|
||||
traits::{Saturating, Zero},
|
||||
RuntimeDebug,
|
||||
};
|
||||
use sp_std::{convert::TryFrom, prelude::*, result::Result};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
/// A number of lock periods, plus a vote, one way or the other.
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Default, RuntimeDebug, MaxEncodedLen)]
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
convert::TryInto,
|
||||
hash::Hash,
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
use crate::{mock::*, IndexAssignment, NposSolution};
|
||||
use frame_support::traits::ConstU32;
|
||||
use rand::SeedableRng;
|
||||
use std::convert::TryInto;
|
||||
|
||||
mod solution_type {
|
||||
use super::*;
|
||||
@@ -30,7 +29,7 @@ mod solution_type {
|
||||
// these need to come from the same dev-dependency `frame-election-provider-support`, not from
|
||||
// the crate.
|
||||
use crate::{generate_solution_type, Assignment, Error as NposError, NposSolution};
|
||||
use sp_std::{convert::TryInto, fmt::Debug};
|
||||
use sp_std::fmt::Debug;
|
||||
|
||||
#[allow(dead_code)]
|
||||
mod __private {
|
||||
|
||||
@@ -22,16 +22,12 @@ use codec::Encode;
|
||||
use scale_info::TypeInfo;
|
||||
use sp_arithmetic::traits::{Bounded, UniqueSaturatedInto};
|
||||
use sp_npos_elections::{ElectionScore, Error, EvaluateSupport};
|
||||
use sp_std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt::Debug,
|
||||
prelude::*,
|
||||
};
|
||||
use sp_std::{fmt::Debug, prelude::*};
|
||||
|
||||
/// An opaque index-based, NPoS solution type.
|
||||
pub trait NposSolution
|
||||
where
|
||||
Self: Sized + for<'a> sp_std::convert::TryFrom<&'a [IndexAssignmentOf<Self>], Error = Error>,
|
||||
Self: Sized + for<'a> TryFrom<&'a [IndexAssignmentOf<Self>], Error = Error>,
|
||||
{
|
||||
/// The maximum number of votes that are allowed.
|
||||
const LIMIT: usize;
|
||||
|
||||
@@ -104,7 +104,7 @@ use sp_staking::{
|
||||
offence::{Kind, Offence, ReportOffence},
|
||||
SessionIndex,
|
||||
};
|
||||
use sp_std::{convert::TryInto, prelude::*};
|
||||
use sp_std::prelude::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
pub mod sr25519 {
|
||||
|
||||
@@ -37,7 +37,7 @@ mod tests;
|
||||
pub mod weights;
|
||||
|
||||
use sp_runtime::traits::{BadOrigin, Hash, Saturating};
|
||||
use sp_std::{convert::TryFrom, prelude::*};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
use codec::{Decode, Encode, MaxEncodedLen};
|
||||
use frame_support::{
|
||||
|
||||
@@ -48,7 +48,7 @@ use sp_runtime::{
|
||||
traits::{Dispatchable, Hash, Saturating, TrailingZeroInput, Zero},
|
||||
DispatchResult,
|
||||
};
|
||||
use sp_std::{convert::TryInto, prelude::*};
|
||||
use sp_std::prelude::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
pub use pallet::*;
|
||||
|
||||
@@ -71,7 +71,6 @@ use safe_mix::TripletMix;
|
||||
use codec::Encode;
|
||||
use frame_support::traits::Randomness;
|
||||
use sp_runtime::traits::{Hash, Saturating};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
const RANDOM_MATERIAL_LEN: u32 = 81;
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ use proc_macro::TokenStream;
|
||||
use proc_macro2::{Span, TokenStream as TokenStream2};
|
||||
use proc_macro_crate::{crate_name, FoundCrate};
|
||||
use quote::{quote, ToTokens};
|
||||
use std::convert::TryInto;
|
||||
use syn::parse::{Parse, ParseStream};
|
||||
|
||||
/// Accepts a number of expressions to create a instance of PiecewiseLinear which represents the
|
||||
|
||||
@@ -316,7 +316,7 @@ use sp_staking::{
|
||||
offence::{Offence, OffenceError, ReportOffence},
|
||||
EraIndex, SessionIndex,
|
||||
};
|
||||
use sp_std::{collections::btree_map::BTreeMap, convert::From, prelude::*};
|
||||
use sp_std::{collections::btree_map::BTreeMap, prelude::*};
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
pub use pallet::{pallet::*, *};
|
||||
|
||||
@@ -33,7 +33,7 @@ use sp_runtime::{
|
||||
DispatchError, Perbill, Percent,
|
||||
};
|
||||
use sp_staking::{EraIndex, SessionIndex};
|
||||
use sp_std::{cmp::max, convert::From, prelude::*};
|
||||
use sp_std::{cmp::max, prelude::*};
|
||||
|
||||
mod impls;
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ fn expand_event_conversion(
|
||||
Event::#variant_name(x)
|
||||
}
|
||||
}
|
||||
impl #scrate::sp_std::convert::TryInto<#pallet_event> for Event {
|
||||
impl TryInto<#pallet_event> for Event {
|
||||
type Error = ();
|
||||
|
||||
fn try_into(self) -> #scrate::sp_std::result::Result<#pallet_event, Self::Error> {
|
||||
|
||||
@@ -230,7 +230,7 @@ pub fn expand_outer_origin(
|
||||
}
|
||||
}
|
||||
|
||||
impl #scrate::sp_std::convert::TryFrom<OriginCaller> for #system_path::Origin<#runtime> {
|
||||
impl TryFrom<OriginCaller> for #system_path::Origin<#runtime> {
|
||||
type Error = OriginCaller;
|
||||
fn try_from(x: OriginCaller)
|
||||
-> #scrate::sp_std::result::Result<#system_path::Origin<#runtime>, OriginCaller>
|
||||
@@ -359,7 +359,7 @@ fn expand_origin_pallet_conversions(
|
||||
}
|
||||
}
|
||||
|
||||
impl #scrate::sp_std::convert::TryFrom<OriginCaller> for #pallet_origin {
|
||||
impl TryFrom<OriginCaller> for #pallet_origin {
|
||||
type Error = OriginCaller;
|
||||
fn try_from(
|
||||
x: OriginCaller,
|
||||
|
||||
@@ -162,7 +162,7 @@ pub fn expand_error(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
|
||||
#frame_support::sp_runtime::DispatchError::Module(#frame_support::sp_runtime::ModuleError {
|
||||
index,
|
||||
error: core::convert::TryInto::try_into(encoded).expect("encoded error is resized to be equal to the maximum encoded error size; qed"),
|
||||
error: TryInto::try_into(encoded).expect("encoded error is resized to be equal to the maximum encoded error size; qed"),
|
||||
message: Some(err.as_str()),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ macro_rules! decl_error {
|
||||
|
||||
$crate::sp_runtime::DispatchError::Module($crate::sp_runtime::ModuleError {
|
||||
index,
|
||||
error: core::convert::TryInto::try_into(error).expect("encoded error is resized to be equal to the maximum encoded error size; qed"),
|
||||
error: TryInto::try_into(error).expect("encoded error is resized to be equal to the maximum encoded error size; qed"),
|
||||
message: Some(err.as_str()),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -127,13 +127,11 @@ impl TypeId for PalletId {
|
||||
macro_rules! bounded_vec {
|
||||
($ ($values:expr),* $(,)?) => {
|
||||
{
|
||||
use $crate::sp_std::convert::TryInto as _;
|
||||
$crate::sp_std::vec![$($values),*].try_into().unwrap()
|
||||
}
|
||||
};
|
||||
( $value:expr ; $repetition:expr ) => {
|
||||
{
|
||||
use $crate::sp_std::convert::TryInto as _;
|
||||
$crate::sp_std::vec![$value ; $repetition].try_into().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,7 @@ use crate::{
|
||||
traits::{Get, TryCollect},
|
||||
};
|
||||
use codec::{Decode, Encode, MaxEncodedLen};
|
||||
use sp_std::{
|
||||
borrow::Borrow, collections::btree_map::BTreeMap, convert::TryFrom, marker::PhantomData,
|
||||
ops::Deref,
|
||||
};
|
||||
use sp_std::{borrow::Borrow, collections::btree_map::BTreeMap, marker::PhantomData, ops::Deref};
|
||||
|
||||
/// A bounded map based on a B-Tree.
|
||||
///
|
||||
|
||||
@@ -22,10 +22,7 @@ use crate::{
|
||||
traits::{Get, TryCollect},
|
||||
};
|
||||
use codec::{Decode, Encode, MaxEncodedLen};
|
||||
use sp_std::{
|
||||
borrow::Borrow, collections::btree_set::BTreeSet, convert::TryFrom, marker::PhantomData,
|
||||
ops::Deref,
|
||||
};
|
||||
use sp_std::{borrow::Borrow, collections::btree_set::BTreeSet, marker::PhantomData, ops::Deref};
|
||||
|
||||
/// A bounded set based on a B-Tree.
|
||||
///
|
||||
@@ -324,7 +321,6 @@ pub mod test {
|
||||
use crate::Twox128;
|
||||
use frame_support::traits::ConstU32;
|
||||
use sp_io::TestExternalities;
|
||||
use sp_std::convert::TryInto;
|
||||
|
||||
crate::generate_storage_alias! { Prefix, Foo => Value<BoundedBTreeSet<u32, ConstU32<7>>> }
|
||||
crate::generate_storage_alias! { Prefix, FooMap => Map<(Twox128, u32), BoundedBTreeSet<u32, ConstU32<7>>> }
|
||||
|
||||
@@ -27,7 +27,7 @@ use core::{
|
||||
ops::{Deref, Index, IndexMut},
|
||||
slice::SliceIndex,
|
||||
};
|
||||
use sp_std::{convert::TryFrom, marker::PhantomData, prelude::*};
|
||||
use sp_std::{marker::PhantomData, prelude::*};
|
||||
|
||||
/// A weakly bounded vector.
|
||||
///
|
||||
@@ -320,7 +320,6 @@ pub mod test {
|
||||
use crate::Twox128;
|
||||
use frame_support::traits::ConstU32;
|
||||
use sp_io::TestExternalities;
|
||||
use sp_std::convert::TryInto;
|
||||
|
||||
crate::generate_storage_alias! { Prefix, Foo => Value<WeakBoundedVec<u32, ConstU32<7>>> }
|
||||
crate::generate_storage_alias! { Prefix, FooMap => Map<(Twox128, u32), WeakBoundedVec<u32, ConstU32<7>>> }
|
||||
|
||||
@@ -30,7 +30,7 @@ use frame_support::{
|
||||
};
|
||||
use frame_system::RawOrigin as SystemOrigin;
|
||||
use sp_runtime::traits::Bounded;
|
||||
use sp_std::{convert::TryInto, prelude::*};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
use crate::Pallet as Uniques;
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ use sp_runtime::{
|
||||
},
|
||||
RuntimeDebug,
|
||||
};
|
||||
use sp_std::{convert::TryInto, fmt::Debug, prelude::*};
|
||||
use sp_std::{fmt::Debug, prelude::*};
|
||||
pub use vesting_info::*;
|
||||
pub use weights::WeightInfo;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ pub use scale_info;
|
||||
#[cfg(feature = "std")]
|
||||
pub use serde;
|
||||
#[doc(hidden)]
|
||||
pub use sp_std::{convert::TryFrom, ops::Deref, vec::Vec};
|
||||
pub use sp_std::{ops::Deref, vec::Vec};
|
||||
|
||||
pub mod ecdsa;
|
||||
pub mod ed25519;
|
||||
@@ -363,7 +363,7 @@ macro_rules! app_crypto_public_common {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> $crate::TryFrom<&'a [u8]> for Public {
|
||||
impl<'a> TryFrom<&'a [u8]> for Public {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: &'a [u8]) -> Result<Self, Self::Error> {
|
||||
@@ -518,7 +518,7 @@ macro_rules! app_crypto_signature_common {
|
||||
type Generic = $sig;
|
||||
}
|
||||
|
||||
impl<'a> $crate::TryFrom<&'a [u8]> for Signature {
|
||||
impl<'a> TryFrom<&'a [u8]> for Signature {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: &'a [u8]) -> Result<Self, Self::Error> {
|
||||
@@ -526,7 +526,7 @@ macro_rules! app_crypto_signature_common {
|
||||
}
|
||||
}
|
||||
|
||||
impl $crate::TryFrom<$crate::Vec<u8>> for Signature {
|
||||
impl TryFrom<$crate::Vec<u8>> for Signature {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: $crate::Vec<u8>) -> Result<Self, Self::Error> {
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
use honggfuzz::fuzz;
|
||||
use sp_arithmetic::biguint::{BigUint, Single};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
fn main() {
|
||||
loop {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
use honggfuzz::fuzz;
|
||||
use sp_arithmetic::Normalizable;
|
||||
use std::convert::TryInto;
|
||||
|
||||
type Ty = u64;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
use num_traits::{One, Zero};
|
||||
use sp_std::{cell::RefCell, cmp::Ordering, convert::TryFrom, ops, prelude::*, vec};
|
||||
use sp_std::{cell::RefCell, cmp::Ordering, ops, prelude::*, vec};
|
||||
|
||||
// A sensible value for this would be half of the dword size of the host machine. Since the
|
||||
// runtime is compiled to 32bit webassembly, using 32 and 64 for single and double respectively
|
||||
@@ -664,7 +664,6 @@ pub mod tests {
|
||||
|
||||
#[test]
|
||||
fn can_try_build_numbers_from_types() {
|
||||
use sp_std::convert::TryFrom;
|
||||
assert_eq!(u64::try_from(with_limbs(1)).unwrap(), 1);
|
||||
assert_eq!(u64::try_from(with_limbs(2)).unwrap(), u32::MAX as u64 + 2);
|
||||
assert_eq!(u64::try_from(with_limbs(3)).unwrap_err(), "cannot fit a number into u64");
|
||||
|
||||
@@ -27,7 +27,6 @@ use crate::{
|
||||
};
|
||||
use codec::{CompactAs, Decode, Encode};
|
||||
use sp_std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt::Debug,
|
||||
ops::{self, Add, Div, Mul, Sub},
|
||||
prelude::*,
|
||||
|
||||
@@ -24,7 +24,6 @@ use crate::biguint;
|
||||
use num_traits::Zero;
|
||||
use sp_std::{
|
||||
cmp::{max, min},
|
||||
convert::TryInto,
|
||||
mem,
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ pub use fixed_point::{FixedI128, FixedI64, FixedPointNumber, FixedPointOperand,
|
||||
pub use per_things::{InnerOf, PerThing, PerU16, Perbill, Percent, Permill, Perquintill, UpperOf};
|
||||
pub use rational::{Rational128, RationalInfinite};
|
||||
|
||||
use sp_std::{cmp::Ordering, convert::TryInto, fmt::Debug, prelude::*};
|
||||
use sp_std::{cmp::Ordering, fmt::Debug, prelude::*};
|
||||
use traits::{BaseArithmetic, One, SaturatedConversion, Unsigned, Zero};
|
||||
|
||||
/// Trait for comparing two numbers with an threshold.
|
||||
|
||||
@@ -25,7 +25,6 @@ use crate::traits::{
|
||||
use codec::{CompactAs, Encode};
|
||||
use num_traits::{Pow, SaturatingAdd, SaturatingSub};
|
||||
use sp_std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt, ops,
|
||||
ops::{Add, Sub},
|
||||
prelude::*,
|
||||
|
||||
@@ -23,12 +23,8 @@ pub use num_traits::{
|
||||
checked_pow, Bounded, CheckedAdd, CheckedDiv, CheckedMul, CheckedNeg, CheckedRem, CheckedShl,
|
||||
CheckedShr, CheckedSub, One, Signed, Unsigned, Zero,
|
||||
};
|
||||
use sp_std::{
|
||||
self,
|
||||
convert::{TryFrom, TryInto},
|
||||
ops::{
|
||||
Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Shl, Shr, Sub, SubAssign,
|
||||
},
|
||||
use sp_std::ops::{
|
||||
Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, RemAssign, Shl, Shr, Sub, SubAssign,
|
||||
};
|
||||
|
||||
/// A meta trait for arithmetic type operations, regardless of any limitation on size.
|
||||
|
||||
@@ -86,13 +86,13 @@ pub enum Error {
|
||||
CannotSign(Vec<u8>, String),
|
||||
}
|
||||
|
||||
impl core::convert::From<Public> for Error {
|
||||
impl From<Public> for Error {
|
||||
fn from(p: Public) -> Self {
|
||||
Self::InvalidAuthority(p)
|
||||
}
|
||||
}
|
||||
|
||||
impl core::convert::From<String> for Error {
|
||||
impl From<String> for Error {
|
||||
fn from(s: String) -> Self {
|
||||
Self::StateUnavailable(s)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ use codec::{Decode, Encode, EncodeLike};
|
||||
use schnorrkel::errors::MultiSignatureStage;
|
||||
use sp_core::U512;
|
||||
use sp_std::{
|
||||
convert::TryFrom,
|
||||
ops::{Deref, DerefMut},
|
||||
prelude::*,
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ pub use secrecy::SecretString;
|
||||
use sp_runtime_interface::pass_by::PassByInner;
|
||||
#[doc(hidden)]
|
||||
pub use sp_std::ops::Deref;
|
||||
use sp_std::{convert::TryFrom, hash::Hash, str, vec::Vec};
|
||||
use sp_std::{hash::Hash, str, vec::Vec};
|
||||
/// Trait to zeroize a memory buffer.
|
||||
pub use zeroize::Zeroize;
|
||||
|
||||
@@ -535,7 +535,7 @@ impl From<[u8; 32]> for AccountId32 {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> sp_std::convert::TryFrom<&'a [u8]> for AccountId32 {
|
||||
impl<'a> TryFrom<&'a [u8]> for AccountId32 {
|
||||
type Error = ();
|
||||
fn try_from(x: &'a [u8]) -> Result<AccountId32, ()> {
|
||||
if x.len() == 32 {
|
||||
|
||||
@@ -137,7 +137,7 @@ impl AsMut<[u8]> for Public {
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_std::convert::TryFrom<&[u8]> for Public {
|
||||
impl TryFrom<&[u8]> for Public {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: &[u8]) -> Result<Self, Self::Error> {
|
||||
@@ -209,7 +209,7 @@ impl<'de> Deserialize<'de> for Public {
|
||||
#[derive(Encode, Decode, MaxEncodedLen, PassByInner, TypeInfo, PartialEq, Eq)]
|
||||
pub struct Signature(pub [u8; 65]);
|
||||
|
||||
impl sp_std::convert::TryFrom<&[u8]> for Signature {
|
||||
impl TryFrom<&[u8]> for Signature {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: &[u8]) -> Result<Self, Self::Error> {
|
||||
|
||||
@@ -39,8 +39,6 @@ use crate::crypto::{DeriveJunction, Pair as TraitPair, SecretStringError};
|
||||
#[cfg(feature = "std")]
|
||||
use bip39::{Language, Mnemonic, MnemonicType};
|
||||
#[cfg(feature = "full_crypto")]
|
||||
use core::convert::TryFrom;
|
||||
#[cfg(feature = "full_crypto")]
|
||||
use ed25519_dalek::{Signer as _, Verifier as _};
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||
@@ -116,7 +114,7 @@ impl Deref for Public {
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_std::convert::TryFrom<&[u8]> for Public {
|
||||
impl TryFrom<&[u8]> for Public {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: &[u8]) -> Result<Self, Self::Error> {
|
||||
@@ -215,7 +213,7 @@ impl<'de> Deserialize<'de> for Public {
|
||||
#[derive(Encode, Decode, MaxEncodedLen, PassByInner, TypeInfo, PartialEq, Eq)]
|
||||
pub struct Signature(pub [u8; 64]);
|
||||
|
||||
impl sp_std::convert::TryFrom<&[u8]> for Signature {
|
||||
impl TryFrom<&[u8]> for Signature {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: &[u8]) -> Result<Self, Self::Error> {
|
||||
|
||||
@@ -21,10 +21,7 @@ use crate::{OpaquePeerId, RuntimeDebug};
|
||||
use codec::{Decode, Encode};
|
||||
use scale_info::TypeInfo;
|
||||
use sp_runtime_interface::pass_by::{PassByCodec, PassByEnum, PassByInner};
|
||||
use sp_std::{
|
||||
convert::TryFrom,
|
||||
prelude::{Box, Vec},
|
||||
};
|
||||
use sp_std::prelude::{Box, Vec};
|
||||
|
||||
pub use crate::crypto::KeyTypeId;
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@ use schnorrkel::{
|
||||
#[cfg(feature = "full_crypto")]
|
||||
use sp_std::vec::Vec;
|
||||
#[cfg(feature = "std")]
|
||||
use std::convert::TryFrom;
|
||||
#[cfg(feature = "std")]
|
||||
use substrate_bip39::mini_secret_from_entropy;
|
||||
|
||||
use crate::{
|
||||
@@ -142,7 +140,7 @@ impl std::str::FromStr for Public {
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_std::convert::TryFrom<&[u8]> for Public {
|
||||
impl TryFrom<&[u8]> for Public {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: &[u8]) -> Result<Self, Self::Error> {
|
||||
@@ -215,7 +213,7 @@ impl<'de> Deserialize<'de> for Public {
|
||||
#[derive(Encode, Decode, MaxEncodedLen, PassByInner, TypeInfo, PartialEq, Eq)]
|
||||
pub struct Signature(pub [u8; 64]);
|
||||
|
||||
impl sp_std::convert::TryFrom<&[u8]> for Signature {
|
||||
impl TryFrom<&[u8]> for Signature {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(data: &[u8]) -> Result<Self, Self::Error> {
|
||||
|
||||
@@ -20,10 +20,7 @@
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sp_core::U256;
|
||||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt::Debug,
|
||||
};
|
||||
use std::fmt::Debug;
|
||||
|
||||
/// A number type that can be serialized both as a number or a string that encodes a number in a
|
||||
/// string.
|
||||
|
||||
@@ -51,7 +51,7 @@ pub fn derive_impl(input: DeriveInput) -> Result<TokenStream> {
|
||||
type PassBy = #crate_::pass_by::Enum<#ident>;
|
||||
}
|
||||
|
||||
impl #crate_::sp_std::convert::TryFrom<u8> for #ident {
|
||||
impl TryFrom<u8> for #ident {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(inner: u8) -> #crate_::sp_std::result::Result<Self, ()> {
|
||||
|
||||
@@ -33,7 +33,7 @@ use crate::wasm::*;
|
||||
#[cfg(feature = "std")]
|
||||
use sp_wasm_interface::{FunctionContext, Pointer, Result};
|
||||
|
||||
use sp_std::{convert::TryFrom, marker::PhantomData};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use sp_std::vec::Vec;
|
||||
@@ -382,7 +382,7 @@ impl<T: PassByInner<Inner = I>, I: RIType> RIType for Inner<T, I> {
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// impl std::convert::TryFrom<u8> for Test {
|
||||
/// impl TryFrom<u8> for Test {
|
||||
/// type Error = ();
|
||||
///
|
||||
/// fn try_from(val: u8) -> Result<Test, ()> {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
use sp_runtime_interface::runtime_interface;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use sp_std::{convert::TryFrom, mem, prelude::*};
|
||||
use sp_std::{mem, prelude::*};
|
||||
|
||||
use sp_core::{sr25519::Public, wasm_export_functions};
|
||||
|
||||
|
||||
@@ -110,8 +110,6 @@ where
|
||||
|
||||
#[test]
|
||||
fn test_multiply_by_rational_saturating() {
|
||||
use std::convert::TryInto;
|
||||
|
||||
let div = 100u32;
|
||||
for value in 0..=div {
|
||||
for p in 0..=div {
|
||||
@@ -132,8 +130,6 @@ fn test_multiply_by_rational_saturating() {
|
||||
|
||||
#[test]
|
||||
fn test_calculate_for_fraction_times_denominator() {
|
||||
use std::convert::TryInto;
|
||||
|
||||
let curve = PiecewiseLinear {
|
||||
points: &[
|
||||
(Perbill::from_parts(0_000_000_000), Perbill::from_parts(0_500_000_000)),
|
||||
|
||||
@@ -29,7 +29,7 @@ use crate::{
|
||||
#[cfg(feature = "std")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sp_core::U256;
|
||||
use sp_std::{convert::TryFrom, fmt::Debug};
|
||||
use sp_std::fmt::Debug;
|
||||
|
||||
/// Abstraction over a block header for a substrate chain.
|
||||
#[derive(Encode, Decode, PartialEq, Eq, Clone, sp_core::RuntimeDebug, TypeInfo)]
|
||||
|
||||
@@ -50,7 +50,7 @@ use sp_core::{
|
||||
hash::{H256, H512},
|
||||
sr25519,
|
||||
};
|
||||
use sp_std::{convert::TryFrom, prelude::*};
|
||||
use sp_std::prelude::*;
|
||||
|
||||
use codec::{Decode, Encode, MaxEncodedLen};
|
||||
use scale_info::TypeInfo;
|
||||
|
||||
@@ -37,13 +37,7 @@ pub use sp_arithmetic::traits::{
|
||||
UniqueSaturatedFrom, UniqueSaturatedInto, Zero,
|
||||
};
|
||||
use sp_core::{self, storage::StateVersion, Hasher, RuntimeDebug, TypeId};
|
||||
use sp_std::{
|
||||
self,
|
||||
convert::{TryFrom, TryInto},
|
||||
fmt::Debug,
|
||||
marker::PhantomData,
|
||||
prelude::*,
|
||||
};
|
||||
use sp_std::{self, fmt::Debug, marker::PhantomData, prelude::*};
|
||||
#[cfg(feature = "std")]
|
||||
use std::fmt::Display;
|
||||
#[cfg(feature = "std")]
|
||||
|
||||
@@ -103,7 +103,6 @@ pub mod prelude {
|
||||
boxed::Box,
|
||||
clone::Clone,
|
||||
cmp::{Eq, PartialEq, Reverse},
|
||||
convert::{TryFrom, TryInto},
|
||||
iter::IntoIterator,
|
||||
vec::Vec,
|
||||
};
|
||||
|
||||
@@ -423,7 +423,7 @@ impl From<StateVersion> for u8 {
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_std::convert::TryFrom<u8> for StateVersion {
|
||||
impl TryFrom<u8> for StateVersion {
|
||||
type Error = ();
|
||||
fn try_from(val: u8) -> sp_std::result::Result<StateVersion, ()> {
|
||||
match val {
|
||||
|
||||
@@ -73,7 +73,7 @@ impl From<ValueType> for u8 {
|
||||
}
|
||||
}
|
||||
|
||||
impl sp_std::convert::TryFrom<u8> for ValueType {
|
||||
impl TryFrom<u8> for ValueType {
|
||||
type Error = ();
|
||||
|
||||
fn try_from(val: u8) -> sp_std::result::Result<ValueType, ()> {
|
||||
|
||||
@@ -122,7 +122,6 @@ async fn init_prometheus_with_listener(
|
||||
mod tests {
|
||||
use super::*;
|
||||
use hyper::{Client, Uri};
|
||||
use std::convert::TryFrom;
|
||||
|
||||
#[test]
|
||||
fn prometheus_works() {
|
||||
|
||||
Reference in New Issue
Block a user