Convert all UK spelling to US (#2138)

* all the ise

* forgot a misspelling

* a few more replacements

* bump impl

* rollback and fixes

* bump impl again

* Add aliases for RPC

* Update on_demand.rs
This commit is contained in:
joe petrowski
2019-03-29 14:11:45 +01:00
committed by Gav Wood
parent a10e86ba5a
commit 0ddcbf747f
74 changed files with 453 additions and 451 deletions
+13 -13
View File
@@ -26,11 +26,11 @@ use crate::{Exposure, BalanceOf, Trait, ValidatorPrefs, IndividualExposure};
/// Configure the behavior of the Phragmen election.
/// Might be deprecated.
pub struct ElectionConfig<Balance: HasCompact> {
/// Perform equalise?.
pub equalise: bool,
/// Number of equalise iterations.
/// Perform equalize?.
pub equalize: bool,
/// Number of equalize iterations.
pub iterations: usize,
/// Tolerance of max change per equalise iteration.
/// Tolerance of max change per equalize iteration.
pub tolerance: Balance,
}
@@ -48,7 +48,7 @@ pub struct Candidate<AccountId, Balance: HasCompact> {
approval_stake: Balance,
/// Flag for being elected.
elected: bool,
/// This is most often equal to `Exposure.total` but not always. Needed for [`equalise`]
/// This is most often equal to `Exposure.total` but not always. Needed for [`equalize`]
backing_stake: Balance
}
@@ -78,9 +78,9 @@ pub struct Edge<AccountId, Balance: HasCompact> {
backing_stake: Balance,
/// Index of the candidate stored in the 'candidates' vector
candidate_index: usize,
/// Index of the candidate stored in the 'elected_candidates' vector. Used only with equalise.
/// Index of the candidate stored in the 'elected_candidates' vector. Used only with equalize.
elected_idx: usize,
/// Indicates if this edge is a vote for an elected candidate. Used only with equalise.
/// Indicates if this edge is a vote for an elected candidate. Used only with equalize.
elected: bool,
}
@@ -223,10 +223,10 @@ pub fn elect<T: Trait + 'static, FR, FN, FV, FS>(
}
}
// Optionally perform equalise post-processing.
if config.equalise {
// Optionally perform equalize post-processing.
if config.equalize {
let tolerance = config.tolerance;
let equalise_iterations = config.iterations;
let equalize_iterations = config.iterations;
// Fix indexes
nominators.iter_mut().for_each(|n| {
@@ -237,10 +237,10 @@ pub fn elect<T: Trait + 'static, FR, FN, FV, FS>(
});
});
for _i in 0..equalise_iterations {
for _i in 0..equalize_iterations {
let mut max_diff = <BalanceOf<T>>::zero();
nominators.iter_mut().for_each(|mut n| {
let diff = equalise::<T>(&mut n, &mut elected_candidates, tolerance);
let diff = equalize::<T>(&mut n, &mut elected_candidates, tolerance);
if diff > max_diff {
max_diff = diff;
}
@@ -274,7 +274,7 @@ pub fn elect<T: Trait + 'static, FR, FN, FV, FS>(
Some(elected_candidates)
}
pub fn equalise<T: Trait + 'static>(
pub fn equalize<T: Trait + 'static>(
nominator: &mut Nominator<T::AccountId, BalanceOf<T>>,
elected_candidates: &mut Vec<Candidate<T::AccountId, BalanceOf<T>>>,
tolerance: BalanceOf<T>