Fix warnings when compiling runtime. (#4332)

* Remove warnings when compiling runtime.

* Remove dispatch::Result imports.

* Add missing imports.

* Fix missing vecs. #4333

* Fix oom function.

* Remove superfluous import.

* More warnings.
This commit is contained in:
Tomasz Drwięga
2019-12-10 14:21:34 +01:00
committed by Bastian Köcher
parent 057e298b1f
commit 1f84d6d41d
25 changed files with 104 additions and 87 deletions
+3 -3
View File
@@ -125,7 +125,7 @@ use sp_runtime::{KeyTypeId, Perbill, RuntimeAppPublic, BoundToRuntimeAppPublic};
use support::weights::SimpleDispatchInfo;
use sp_runtime::traits::{Convert, Zero, Member, OpaqueKeys};
use sp_staking::SessionIndex;
use support::{dispatch::Result, ConsensusEngineId, decl_module, decl_event, decl_storage};
use support::{dispatch, ConsensusEngineId, decl_module, decl_event, decl_storage};
use support::{ensure, traits::{OnFreeBalanceZero, Get, FindAuthor, ValidatorRegistration}, Parameter};
use system::{self, ensure_signed};
@@ -483,7 +483,7 @@ decl_module! {
/// - One extra DB entry.
/// # </weight>
#[weight = SimpleDispatchInfo::FixedNormal(150_000)]
fn set_keys(origin, keys: T::Keys, proof: Vec<u8>) -> Result {
fn set_keys(origin, keys: T::Keys, proof: Vec<u8>) -> dispatch::Result {
let who = ensure_signed(origin)?;
ensure!(keys.ownership_proof_is_valid(&proof), "invalid ownership proof");
@@ -631,7 +631,7 @@ impl<T: Trait> Module<T> {
// perform the set_key operation, checking for duplicates.
// does not set `Changed`.
fn do_set_keys(who: &T::ValidatorId, keys: T::Keys) -> Result {
fn do_set_keys(who: &T::ValidatorId, keys: T::Keys) -> dispatch::Result {
let old_keys = Self::load_keys(&who);
for id in T::Keys::key_ids() {