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
@@ -29,7 +29,7 @@ use sp_npos_elections::{
ExtendedBalance, CompactSolution,
};
use sp_runtime::{
offchain::storage::StorageValueRef, traits::TrailingZeroInput, PerThing, RuntimeDebug,
offchain::storage::StorageValueRef, traits::TrailingZeroInput, RuntimeDebug,
};
use sp_std::{convert::TryInto, prelude::*};
@@ -326,10 +326,7 @@ pub fn prepare_submission<T: Config>(
) -> Result<
(Vec<ValidatorIndex>, CompactAssignments, ElectionScore, ElectionSize),
OffchainElectionError,
>
where
ExtendedBalance: From<<OffchainAccuracy as PerThing>::Inner>,
{
> {
// make sure that the snapshot is available.
let snapshot_validators =
<Module<T>>::snapshot_validators().ok_or(OffchainElectionError::SnapshotUnavailable)?;