Attempt to remove the where bounds in arithmetic. (#7933)

* Attempt to remove the where bounds.

* Fix further and further.

* Format better.

* Update primitives/npos-elections/src/lib.rs

* fix build

* remove unused
This commit is contained in:
Kian Paimani
2021-01-21 09:39:30 +00:00
committed by GitHub
parent 9031c35114
commit 0dd8cd6277
11 changed files with 125 additions and 139 deletions
@@ -27,7 +27,7 @@ use crate::{
use sp_arithmetic::{
helpers_128bit::multiply_by_rational,
traits::{Bounded, Zero},
InnerOf, Rational128,
Rational128,
};
use sp_std::prelude::*;
@@ -68,10 +68,7 @@ pub fn seq_phragmen<AccountId: IdentifierT, P: PerThing128>(
initial_candidates: Vec<AccountId>,
initial_voters: Vec<(AccountId, VoteWeight, Vec<AccountId>)>,
balance: Option<(usize, ExtendedBalance)>,
) -> Result<ElectionResult<AccountId, P>, crate::Error>
where
ExtendedBalance: From<InnerOf<P>>,
{
) -> Result<ElectionResult<AccountId, P>, crate::Error> {
let (candidates, voters) = setup_inputs(initial_candidates, initial_voters);
let (candidates, mut voters) = seq_phragmen_core::<AccountId>(