mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
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:
@@ -6,7 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
rstd = { package = "sp-std", path = "../sr-std", default-features = false }
|
||||
sp-std = { path = "../std", default-features = false }
|
||||
sp-runtime = { path = "../../primitives/runtime", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -18,6 +18,6 @@ rand = "0.7.2"
|
||||
default = ["std"]
|
||||
std = [
|
||||
"serde",
|
||||
"rstd/std",
|
||||
"sp-std/std",
|
||||
"sp-runtime/std",
|
||||
]
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use rstd::{prelude::*, collections::btree_map::BTreeMap};
|
||||
use sp_std::{prelude::*, collections::btree_map::BTreeMap};
|
||||
use sp_runtime::RuntimeDebug;
|
||||
use sp_runtime::{helpers_128bit::multiply_by_rational, Perbill, Rational128};
|
||||
use sp_runtime::traits::{Zero, Convert, Member, SimpleArithmetic, Saturating, Bounded};
|
||||
|
||||
@@ -23,7 +23,7 @@ use sp_runtime::{
|
||||
assert_eq_error_rate, Perbill,
|
||||
traits::{Convert, Member, SaturatedConversion}
|
||||
};
|
||||
use rstd::collections::btree_map::BTreeMap;
|
||||
use sp_std::collections::btree_map::BTreeMap;
|
||||
|
||||
pub(crate) struct TestCurrencyToVote;
|
||||
impl Convert<Balance, u64> for TestCurrencyToVote {
|
||||
@@ -149,7 +149,7 @@ pub(crate) fn elect_float<A, FS>(
|
||||
if let Some(winner) = candidates
|
||||
.iter_mut()
|
||||
.filter(|c| !c.elected)
|
||||
.min_by(|x, y| x.score.partial_cmp(&y.score).unwrap_or(rstd::cmp::Ordering::Equal))
|
||||
.min_by(|x, y| x.score.partial_cmp(&y.score).unwrap_or(sp_std::cmp::Ordering::Equal))
|
||||
{
|
||||
winner.elected = true;
|
||||
for n in &mut voters {
|
||||
@@ -250,10 +250,10 @@ pub(crate) fn do_equalize_float<A>(
|
||||
if backing_backed_stake.len() > 0 {
|
||||
let max_stake = backing_backed_stake
|
||||
.iter()
|
||||
.max_by(|x, y| x.partial_cmp(&y).unwrap_or(rstd::cmp::Ordering::Equal))
|
||||
.max_by(|x, y| x.partial_cmp(&y).unwrap_or(sp_std::cmp::Ordering::Equal))
|
||||
.expect("vector with positive length will have a max; qed");
|
||||
let min_stake = backed_stakes_iter
|
||||
.min_by(|x, y| x.partial_cmp(&y).unwrap_or(rstd::cmp::Ordering::Equal))
|
||||
.min_by(|x, y| x.partial_cmp(&y).unwrap_or(sp_std::cmp::Ordering::Equal))
|
||||
.expect("iterator with positive length will have a min; qed");
|
||||
|
||||
difference = max_stake - min_stake;
|
||||
@@ -277,7 +277,7 @@ pub(crate) fn do_equalize_float<A>(
|
||||
elected_edges.sort_unstable_by(|x, y|
|
||||
support_map.get(&x.0)
|
||||
.and_then(|x| support_map.get(&y.0).and_then(|y| x.total.partial_cmp(&y.total)))
|
||||
.unwrap_or(rstd::cmp::Ordering::Equal)
|
||||
.unwrap_or(sp_std::cmp::Ordering::Equal)
|
||||
);
|
||||
|
||||
let mut cumulative_stake = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user