Take genesis_storage by ref (#4617)

Instead of having these weird implementation of `BuildStorage for
&ChainSpec` we should just take the `genesis_storage` by ref. The
`BuildStorage` trait changed some time ago to take a self ref anyway,
instead of a self value.

Also fixes warnings in frame-staking
This commit is contained in:
Bastian Köcher
2020-01-14 11:18:56 +01:00
committed by GitHub
parent 4a353f1e81
commit ee5e8050c3
7 changed files with 10 additions and 12 deletions
+2 -4
View File
@@ -283,7 +283,7 @@ use sp_staking::{
use sp_runtime::{Serialize, Deserialize};
use frame_system::{self as system, ensure_signed, ensure_root};
use sp_phragmen::{ExtendedBalance, PhragmenStakedAssignment};
use sp_phragmen::ExtendedBalance;
const DEFAULT_MINIMUM_VALIDATOR_COUNT: u32 = 4;
const MAX_NOMINATIONS: usize = 16;
@@ -1508,12 +1508,10 @@ impl<T: Trait> Module<T> {
.collect::<Vec<T::AccountId>>();
let assignments = phragmen_result.assignments;
let to_votes = |b: BalanceOf<T>|
<T::CurrencyToVote as Convert<BalanceOf<T>, u64>>::convert(b) as ExtendedBalance;
let to_balance = |e: ExtendedBalance|
<T::CurrencyToVote as Convert<ExtendedBalance, BalanceOf<T>>>::convert(e);
let mut supports = sp_phragmen::build_support_map::<_, _, _, T::CurrencyToVote>(
let supports = sp_phragmen::build_support_map::<_, _, _, T::CurrencyToVote>(
&elected_stashes,
&assignments,
Self::slashable_balance_of,