mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 22:27:56 +00:00
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:
@@ -305,7 +305,7 @@ use frame_support::{
|
||||
};
|
||||
use pallet_session::historical;
|
||||
use sp_runtime::{
|
||||
Percent, Perbill, PerU16, InnerOf, RuntimeDebug, DispatchError,
|
||||
Percent, Perbill, PerU16, RuntimeDebug, DispatchError,
|
||||
curve::PiecewiseLinear,
|
||||
traits::{
|
||||
Convert, Zero, StaticLookup, CheckedSub, Saturating, SaturatedConversion,
|
||||
@@ -2991,10 +2991,7 @@ impl<T: Config> Module<T> {
|
||||
/// No storage item is updated.
|
||||
pub fn do_phragmen<Accuracy: PerThing128>(
|
||||
iterations: usize,
|
||||
) -> Option<PrimitiveElectionResult<T::AccountId, Accuracy>>
|
||||
where
|
||||
ExtendedBalance: From<InnerOf<Accuracy>>,
|
||||
{
|
||||
) -> Option<PrimitiveElectionResult<T::AccountId, Accuracy>> {
|
||||
let weight_of = Self::slashable_balance_of_fn();
|
||||
let mut all_nominators: Vec<(T::AccountId, VoteWeight, Vec<T::AccountId>)> = Vec::new();
|
||||
let mut all_validators = Vec::new();
|
||||
|
||||
@@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user