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
+4 -4
View File
@@ -43,7 +43,7 @@
//!
//! ```
//! use frame_support::{decl_module, dispatch};
//! use frame_support::weights::{SimpleDispatchInfo, MINIMUM_WEIGHT};
//! use frame_support::weights::MINIMUM_WEIGHT;
//! use frame_system::{self as system, ensure_signed};
//! use pallet_im_online::{self as im_online};
//!
@@ -51,7 +51,7 @@
//!
//! decl_module! {
//! pub struct Module<T: Trait> for enum Call where origin: T::Origin {
//! #[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
//! #[weight = MINIMUM_WEIGHT]
//! pub fn is_online(origin, authority_index: u32) -> dispatch::DispatchResult {
//! let _sender = ensure_signed(origin)?;
//! let _is_online = <im_online::Module<T>>::is_online(authority_index);
@@ -95,7 +95,7 @@ use sp_staking::{
use frame_support::{
decl_module, decl_event, decl_storage, Parameter, debug, decl_error,
traits::Get,
weights::{SimpleDispatchInfo, MINIMUM_WEIGHT},
weights::MINIMUM_WEIGHT,
};
use frame_system::{self as system, ensure_none};
use frame_system::offchain::{
@@ -315,7 +315,7 @@ decl_module! {
fn deposit_event() = default;
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = MINIMUM_WEIGHT]
fn heartbeat(
origin,
heartbeat: Heartbeat<T::BlockNumber>,