mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 05:11:09 +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:
@@ -25,7 +25,7 @@ use sp_runtime::traits::{
|
||||
StaticLookup, Member, LookupError, Zero, One, BlakeTwo256, Hash, Saturating, AtLeast32Bit
|
||||
};
|
||||
use frame_support::{Parameter, decl_module, decl_error, decl_event, decl_storage, ensure};
|
||||
use frame_support::weights::{Weight, MINIMUM_WEIGHT, SimpleDispatchInfo};
|
||||
use frame_support::weights::{Weight, MINIMUM_WEIGHT};
|
||||
use frame_support::dispatch::DispatchResult;
|
||||
use frame_support::traits::{Currency, ReservableCurrency, Get, BalanceStatus::Reserved};
|
||||
use frame_support::storage::migration::take_storage_value;
|
||||
@@ -121,7 +121,7 @@ decl_module! {
|
||||
/// - One reserve operation.
|
||||
/// - One event.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
#[weight = MINIMUM_WEIGHT]
|
||||
fn claim(origin, index: T::AccountIndex) {
|
||||
let who = ensure_signed(origin)?;
|
||||
|
||||
@@ -149,7 +149,7 @@ decl_module! {
|
||||
/// - One transfer operation.
|
||||
/// - One event.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
#[weight = MINIMUM_WEIGHT]
|
||||
fn transfer(origin, new: T::AccountId, index: T::AccountIndex) {
|
||||
let who = ensure_signed(origin)?;
|
||||
ensure!(who != new, Error::<T>::NotTransfer);
|
||||
@@ -180,7 +180,7 @@ decl_module! {
|
||||
/// - One reserve operation.
|
||||
/// - One event.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
#[weight = MINIMUM_WEIGHT]
|
||||
fn free(origin, index: T::AccountIndex) {
|
||||
let who = ensure_signed(origin)?;
|
||||
|
||||
@@ -209,7 +209,7 @@ decl_module! {
|
||||
/// - Up to one reserve operation.
|
||||
/// - One event.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
#[weight = MINIMUM_WEIGHT]
|
||||
fn force_transfer(origin, new: T::AccountId, index: T::AccountIndex) {
|
||||
ensure_root(origin)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user