Migrate away from SimpleDispatchInfo (#5686)

* Migrate away from SimpleDispatchInfo

* Fix imports

* Better doc

* Update lib.rs

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Kian Paimani
2020-04-22 09:20:28 +02:00
committed by GitHub
parent 25c3ab2c1e
commit 50a7e12b3f
40 changed files with 458 additions and 405 deletions
+3 -3
View File
@@ -110,7 +110,7 @@ use frame_support::{
Get, FindAuthor, ValidatorRegistration, EstimateNextSessionRotation, EstimateNextNewSession,
},
dispatch::{self, DispatchResult, DispatchError},
weights::{Weight, MINIMUM_WEIGHT, SimpleDispatchInfo},
weights::{Weight, MINIMUM_WEIGHT},
};
use frame_system::{self as system, ensure_signed};
@@ -498,7 +498,7 @@ decl_module! {
/// - Increases system account refs by one on success iff there were previously no keys set.
/// In this case, purge_keys will need to be called before the account can be removed.
/// # </weight>
#[weight = SimpleDispatchInfo::FixedNormal(150_000_000)]
#[weight = 150_000_000]
pub fn set_keys(origin, keys: T::Keys, proof: Vec<u8>) -> dispatch::DispatchResult {
let who = ensure_signed(origin)?;
@@ -519,7 +519,7 @@ decl_module! {
/// - Removes N + 1 DB entries.
/// - Reduces system account refs by one on success.
/// # </weight>
#[weight = SimpleDispatchInfo::FixedNormal(150_000_000)]
#[weight = 150_000_000]
pub fn purge_keys(origin) {
let who = ensure_signed(origin)?;
Self::do_purge_keys(&who)?;