diff --git a/substrate/client/chain-spec/src/chain_spec.rs b/substrate/client/chain-spec/src/chain_spec.rs index 6e58083e8c..81cbce5ea7 100644 --- a/substrate/client/chain-spec/src/chain_spec.rs +++ b/substrate/client/chain-spec/src/chain_spec.rs @@ -70,7 +70,7 @@ impl GenesisSource { } } -impl<'a, G: RuntimeGenesis, E> BuildStorage for &'a ChainSpec { +impl BuildStorage for ChainSpec { fn build_storage(&self) -> Result { match self.genesis.resolve()? { Genesis::Runtime(gc) => gc.build_storage(), diff --git a/substrate/client/db/src/lib.rs b/substrate/client/db/src/lib.rs index 06d0dc18ff..b4eae2db2b 100644 --- a/substrate/client/db/src/lib.rs +++ b/substrate/client/db/src/lib.rs @@ -274,7 +274,7 @@ pub enum DatabaseSettingsSrc { pub fn new_client( settings: DatabaseSettings, executor: E, - genesis_storage: S, + genesis_storage: &S, fork_blocks: ForkBlocks, bad_blocks: BadBlocks, execution_extensions: ExecutionExtensions, diff --git a/substrate/client/src/client.rs b/substrate/client/src/client.rs index 2babf6f3e9..aeca433184 100644 --- a/substrate/client/src/client.rs +++ b/substrate/client/src/client.rs @@ -129,7 +129,7 @@ impl PrePostHeader { /// Create an instance of in-memory client. pub fn new_in_mem( executor: E, - genesis_storage: S, + genesis_storage: &S, keystore: Option, ) -> sp_blockchain::Result, @@ -149,7 +149,7 @@ pub fn new_in_mem( pub fn new_with_backend( backend: Arc, executor: E, - build_genesis_storage: S, + build_genesis_storage: &S, keystore: Option, ) -> sp_blockchain::Result, Block, RA>> where @@ -187,7 +187,7 @@ impl Client where pub fn new( backend: Arc, executor: E, - build_genesis_storage: S, + build_genesis_storage: &S, fork_blocks: ForkBlocks, bad_blocks: BadBlocks, execution_extensions: ExecutionExtensions, diff --git a/substrate/client/src/lib.rs b/substrate/client/src/lib.rs index cfaf08ca7e..db2d4785a2 100644 --- a/substrate/client/src/lib.rs +++ b/substrate/client/src/lib.rs @@ -65,7 +65,7 @@ //! NativeExecutor::::new(WasmExecutionMethod::Interpreted, None), //! ), //! // This parameter provides the storage for the chain genesis. -//! ::default(), +//! &::default(), //! Default::default(), //! Default::default(), //! Default::default(), diff --git a/substrate/client/src/light/mod.rs b/substrate/client/src/light/mod.rs index 5052b36d7f..c067fc9caa 100644 --- a/substrate/client/src/light/mod.rs +++ b/substrate/client/src/light/mod.rs @@ -56,7 +56,7 @@ pub fn new_light_backend(blockchain: Arc>) -> Arc( backend: Arc>>, - genesis_storage: GS, + genesis_storage: &GS, code_executor: E, ) -> ClientResult< Client< diff --git a/substrate/frame/staking/src/lib.rs b/substrate/frame/staking/src/lib.rs index 94618c9349..326a015990 100644 --- a/substrate/frame/staking/src/lib.rs +++ b/substrate/frame/staking/src/lib.rs @@ -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 Module { .collect::>(); let assignments = phragmen_result.assignments; - let to_votes = |b: BalanceOf| - , u64>>::convert(b) as ExtendedBalance; let to_balance = |e: ExtendedBalance| >>::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, diff --git a/substrate/test-utils/client/src/lib.rs b/substrate/test-utils/client/src/lib.rs index ac1cfe4d6b..c8d3a809a7 100644 --- a/substrate/test-utils/client/src/lib.rs +++ b/substrate/test-utils/client/src/lib.rs @@ -190,7 +190,7 @@ impl TestClientBuilder let client = sc_client::Client::new( self.backend.clone(), executor, - storage, + &storage, Default::default(), Default::default(), ExecutionExtensions::new(