mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
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:
@@ -10,7 +10,7 @@
|
||||
/// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs
|
||||
|
||||
use frame_support::{decl_module, decl_storage, decl_event, decl_error, dispatch};
|
||||
use frame_support::weights::{SimpleDispatchInfo, MINIMUM_WEIGHT};
|
||||
use frame_support::weights::MINIMUM_WEIGHT;
|
||||
use frame_system::{self as system, ensure_signed};
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -76,7 +76,7 @@ decl_module! {
|
||||
/// Just a dummy entry point.
|
||||
/// function that can be called by the external world as an extrinsics call
|
||||
/// takes a parameter of the type `AccountId`, stores it, and emits an event
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
#[weight = MINIMUM_WEIGHT]
|
||||
pub fn do_something(origin, something: u32) -> dispatch::DispatchResult {
|
||||
// Check it was signed and get the signer. See also: ensure_root and ensure_none
|
||||
let who = ensure_signed(origin)?;
|
||||
@@ -92,7 +92,7 @@ decl_module! {
|
||||
|
||||
/// Another dummy entry point.
|
||||
/// takes no parameters, attempts to increment storage value, and possibly throws an error
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
#[weight = MINIMUM_WEIGHT]
|
||||
pub fn cause_error(origin) -> dispatch::DispatchResult {
|
||||
// Check it was signed and get the signer. See also: ensure_root and ensure_none
|
||||
let _who = ensure_signed(origin)?;
|
||||
|
||||
Reference in New Issue
Block a user