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
@@ -8,7 +8,7 @@ edition = "2018"
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] }
integer-sqrt = "0.1.2"
num-traits = { version = "0.2.8", default-features = false }
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
sp-std = { path = "../std", default-features = false }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
sp-debug-derive = { path = "../../primitives/core/debug-derive", default-features = false }
@@ -22,7 +22,7 @@ default = ["std"]
std = [
"codec/std",
"num-traits/std",
"rstd/std",
"sp-std/std",
"serde",
"sp-debug-derive/std",
]
+15 -15
View File
@@ -285,39 +285,30 @@ dependencies = [
]
[[package]]
name = "sr-arithmetic"
name = "sp-arithmetic"
version = "2.0.0"
dependencies = [
"integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-scale-codec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)",
"sr-std 2.0.0",
"substrate-debug-derive 2.0.0",
"sp-debug-derive 2.0.0",
"sp-std 2.0.0",
]
[[package]]
name = "sr-arithmetic-fuzzer"
name = "sp-arithmetic-fuzzer"
version = "2.0.0"
dependencies = [
"honggfuzz 0.5.45 (registry+https://github.com/rust-lang/crates.io-index)",
"num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"sr-arithmetic 2.0.0",
"sp-arithmetic 2.0.0",
]
[[package]]
name = "sr-std"
version = "2.0.0"
[[package]]
name = "static_assertions"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "substrate-debug-derive"
name = "sp-debug-derive"
version = "2.0.0"
dependencies = [
"proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -325,6 +316,15 @@ dependencies = [
"syn 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "sp-std"
version = "2.0.0"
[[package]]
name = "static_assertions"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "syn"
version = "0.15.44"
@@ -17,7 +17,7 @@
//! Infinite precision unsigned integer for substrate runtime.
use num_traits::Zero;
use rstd::{cmp::Ordering, ops, prelude::*, cell::RefCell, convert::TryFrom};
use sp_std::{cmp::Ordering, ops, prelude::*, cell::RefCell, convert::TryFrom};
// 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
@@ -427,9 +427,9 @@ impl BigUint {
}
}
impl rstd::fmt::Debug for BigUint {
impl sp_std::fmt::Debug for BigUint {
#[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,
"BigUint {{ {:?} ({:?})}}",
@@ -439,7 +439,7 @@ impl rstd::fmt::Debug for BigUint {
}
#[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(())
}
@@ -646,7 +646,7 @@ pub mod tests {
#[test]
fn can_try_build_numbers_from_types() {
use rstd::convert::TryFrom;
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_value() as u64 + 2);
assert_eq!(
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use rstd::{
use sp_std::{
ops, prelude::*,
convert::{TryFrom, TryInto},
};
@@ -179,14 +179,14 @@ impl CheckedDiv for Fixed64 {
}
}
impl rstd::fmt::Debug for Fixed64 {
impl sp_std::fmt::Debug for Fixed64 {
#[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, "Fixed64({},{})", self.0 / DIV, (self.0 % DIV) / 1000)
}
#[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(())
}
}
@@ -21,7 +21,7 @@
use crate::biguint;
use num_traits::Zero;
use rstd::{cmp::{min, max}, convert::TryInto, mem};
use sp_std::{cmp::{min, max}, convert::TryInto, mem};
/// Helper gcd function used in Rational128 implementation.
pub fn gcd(a: u128, b: u128) -> u128 {
@@ -17,7 +17,7 @@
#[cfg(feature = "std")]
use serde::{Serialize, Deserialize};
use rstd::{ops, prelude::*, convert::TryInto};
use sp_std::{ops, prelude::*, convert::TryInto};
use codec::{Encode, Decode, CompactAs};
use crate::traits::{SaturatedConversion, UniqueSaturatedInto, Saturating};
use sp_debug_derive::RuntimeDebug;
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
use rstd::{cmp::Ordering, prelude::*};
use sp_std::{cmp::Ordering, prelude::*};
use crate::helpers_128bit;
use num_traits::Zero;
use sp_debug_derive::RuntimeDebug;
@@ -16,14 +16,14 @@
//! Primitives for the runtime modules.
use rstd::{self, convert::{TryFrom, TryInto}};
use sp_std::{self, convert::{TryFrom, TryInto}};
use codec::HasCompact;
pub use integer_sqrt::IntegerSquareRoot;
pub use num_traits::{
Zero, One, Bounded, CheckedAdd, CheckedSub, CheckedMul, CheckedDiv,
CheckedShl, CheckedShr
};
use rstd::ops::{
use sp_std::ops::{
Add, Sub, Mul, Div, Rem, AddAssign, SubAssign, MulAssign, DivAssign,
RemAssign, Shl, Shr
};