Rename: primitives/sr-std -> primitives/sp-std (#4327)

* primitives/sr-std -> primitives/std

* fix

* fix conflict

* rstd -> sp-std

* git mv

* fix review

* fix merge
This commit is contained in:
Weiliang Li
2019-12-10 16:26:27 +09:00
committed by Gavin Wood
parent 448dbc89a5
commit 6da9f59d72
210 changed files with 552 additions and 556 deletions
+31 -31
View File
@@ -90,11 +90,11 @@
#[cfg(feature = "std")]
use serde::Serialize;
use rstd::prelude::*;
use sp_std::prelude::*;
#[cfg(any(feature = "std", test))]
use rstd::map;
use rstd::marker::PhantomData;
use rstd::fmt::Debug;
use sp_std::map;
use sp_std::marker::PhantomData;
use sp_std::fmt::Debug;
use sp_version::RuntimeVersion;
use sp_runtime::{
RuntimeDebug,
@@ -172,12 +172,12 @@ pub trait Trait: 'static + Eq + Clone {
/// The block number type used by the runtime.
type BlockNumber:
Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + SimpleArithmetic
+ Default + Bounded + Copy + rstd::hash::Hash;
+ Default + Bounded + Copy + sp_std::hash::Hash;
/// The output of the `Hashing` function.
type Hash:
Parameter + Member + MaybeSerializeDeserialize + Debug + MaybeDisplay + SimpleBitOps
+ Default + Copy + CheckEqual + rstd::hash::Hash + AsRef<[u8]> + AsMut<[u8]>;
+ Default + Copy + CheckEqual + sp_std::hash::Hash + AsRef<[u8]> + AsMut<[u8]>;
/// The hashing system (algorithm) being used in the runtime (e.g. Blake2).
type Hashing: Hash<Output = Self::Hash>;
@@ -435,7 +435,7 @@ decl_storage! {
}
}
pub struct EnsureRoot<AccountId>(rstd::marker::PhantomData<AccountId>);
pub struct EnsureRoot<AccountId>(sp_std::marker::PhantomData<AccountId>);
impl<
O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>,
AccountId,
@@ -449,7 +449,7 @@ impl<
}
}
pub struct EnsureSigned<AccountId>(rstd::marker::PhantomData<AccountId>);
pub struct EnsureSigned<AccountId>(sp_std::marker::PhantomData<AccountId>);
impl<
O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>,
AccountId,
@@ -463,7 +463,7 @@ impl<
}
}
pub struct EnsureSignedBy<Who, AccountId>(rstd::marker::PhantomData<(Who, AccountId)>);
pub struct EnsureSignedBy<Who, AccountId>(sp_std::marker::PhantomData<(Who, AccountId)>);
impl<
O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>,
Who: Contains<AccountId>,
@@ -478,7 +478,7 @@ impl<
}
}
pub struct EnsureNone<AccountId>(rstd::marker::PhantomData<AccountId>);
pub struct EnsureNone<AccountId>(sp_std::marker::PhantomData<AccountId>);
impl<
O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>,
AccountId,
@@ -492,7 +492,7 @@ impl<
}
}
pub struct EnsureNever<T>(rstd::marker::PhantomData<T>);
pub struct EnsureNever<T>(sp_std::marker::PhantomData<T>);
impl<O, T> EnsureOrigin<O> for EnsureNever<T> {
type Success = T;
fn try_origin(o: O) -> Result<Self::Success, O> {
@@ -859,7 +859,7 @@ impl<T: Trait + Send + Sync> SignedExtension for CheckWeight<T> {
type DispatchInfo = DispatchInfo;
type Pre = ();
fn additional_signed(&self) -> rstd::result::Result<(), TransactionValidityError> { Ok(()) }
fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { Ok(()) }
fn pre_dispatch(
self,
@@ -899,12 +899,12 @@ impl<T: Trait + Send + Sync> SignedExtension for CheckWeight<T> {
impl<T: Trait + Send + Sync> Debug for CheckWeight<T> {
#[cfg(feature = "std")]
fn fmt(&self, f: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
write!(f, "CheckWeight")
}
#[cfg(not(feature = "std"))]
fn fmt(&self, _: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
Ok(())
}
}
@@ -922,12 +922,12 @@ impl<T: Trait> CheckNonce<T> {
impl<T: Trait> Debug for CheckNonce<T> {
#[cfg(feature = "std")]
fn fmt(&self, f: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
self.0.fmt(f)
}
#[cfg(not(feature = "std"))]
fn fmt(&self, _: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
Ok(())
}
}
@@ -939,7 +939,7 @@ impl<T: Trait> SignedExtension for CheckNonce<T> {
type DispatchInfo = DispatchInfo;
type Pre = ();
fn additional_signed(&self) -> rstd::result::Result<(), TransactionValidityError> { Ok(()) }
fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { Ok(()) }
fn pre_dispatch(
self,
@@ -995,23 +995,23 @@ impl<T: Trait> SignedExtension for CheckNonce<T> {
/// Check for transaction mortality.
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
pub struct CheckEra<T: Trait + Send + Sync>((Era, rstd::marker::PhantomData<T>));
pub struct CheckEra<T: Trait + Send + Sync>((Era, sp_std::marker::PhantomData<T>));
impl<T: Trait + Send + Sync> CheckEra<T> {
/// utility constructor. Used only in client/factory code.
pub fn from(era: Era) -> Self {
Self((era, rstd::marker::PhantomData))
Self((era, sp_std::marker::PhantomData))
}
}
impl<T: Trait + Send + Sync> Debug for CheckEra<T> {
#[cfg(feature = "std")]
fn fmt(&self, f: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
self.0.fmt(f)
}
#[cfg(not(feature = "std"))]
fn fmt(&self, _: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
Ok(())
}
}
@@ -1051,16 +1051,16 @@ impl<T: Trait + Send + Sync> SignedExtension for CheckEra<T> {
/// Nonce check and increment to give replay protection for transactions.
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
pub struct CheckGenesis<T: Trait + Send + Sync>(rstd::marker::PhantomData<T>);
pub struct CheckGenesis<T: Trait + Send + Sync>(sp_std::marker::PhantomData<T>);
impl<T: Trait + Send + Sync> Debug for CheckGenesis<T> {
#[cfg(feature = "std")]
fn fmt(&self, f: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
write!(f, "CheckGenesis")
}
#[cfg(not(feature = "std"))]
fn fmt(&self, _: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
Ok(())
}
}
@@ -1068,7 +1068,7 @@ impl<T: Trait + Send + Sync> Debug for CheckGenesis<T> {
impl<T: Trait + Send + Sync> CheckGenesis<T> {
/// Creates new `SignedExtension` to check genesis hash.
pub fn new() -> Self {
Self(rstd::marker::PhantomData)
Self(sp_std::marker::PhantomData)
}
}
@@ -1086,16 +1086,16 @@ impl<T: Trait + Send + Sync> SignedExtension for CheckGenesis<T> {
/// Ensure the runtime version registered in the transaction is the same as at present.
#[derive(Encode, Decode, Clone, Eq, PartialEq)]
pub struct CheckVersion<T: Trait + Send + Sync>(rstd::marker::PhantomData<T>);
pub struct CheckVersion<T: Trait + Send + Sync>(sp_std::marker::PhantomData<T>);
impl<T: Trait + Send + Sync> Debug for CheckVersion<T> {
#[cfg(feature = "std")]
fn fmt(&self, f: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
write!(f, "CheckVersion")
}
#[cfg(not(feature = "std"))]
fn fmt(&self, _: &mut rstd::fmt::Formatter) -> rstd::fmt::Result {
fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
Ok(())
}
}
@@ -1103,7 +1103,7 @@ impl<T: Trait + Send + Sync> Debug for CheckVersion<T> {
impl<T: Trait + Send + Sync> CheckVersion<T> {
/// Create new `SignedExtension` to check runtime version.
pub fn new() -> Self {
Self(rstd::marker::PhantomData)
Self(sp_std::marker::PhantomData)
}
}
@@ -1119,10 +1119,10 @@ impl<T: Trait + Send + Sync> SignedExtension for CheckVersion<T> {
}
}
pub struct ChainContext<T>(rstd::marker::PhantomData<T>);
pub struct ChainContext<T>(sp_std::marker::PhantomData<T>);
impl<T> Default for ChainContext<T> {
fn default() -> Self {
ChainContext(rstd::marker::PhantomData)
ChainContext(sp_std::marker::PhantomData)
}
}