mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 13:51:11 +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:
@@ -133,7 +133,7 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use frame_support::{Parameter, decl_module, decl_event, decl_storage, decl_error, ensure};
|
||||
use frame_support::weights::{SimpleDispatchInfo, MINIMUM_WEIGHT};
|
||||
use frame_support::weights::MINIMUM_WEIGHT;
|
||||
use sp_runtime::traits::{Member, AtLeast32Bit, Zero, StaticLookup};
|
||||
use frame_system::{self as system, ensure_signed};
|
||||
use sp_runtime::traits::One;
|
||||
@@ -158,7 +158,7 @@ decl_module! {
|
||||
/// Issue a new class of fungible assets. There are, and will only ever be, `total`
|
||||
/// such assets and they'll all belong to the `origin` initially. It will have an
|
||||
/// identifier `AssetId` instance: this will be specified in the `Issued` event.
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
#[weight = MINIMUM_WEIGHT]
|
||||
fn issue(origin, #[compact] total: T::Balance) {
|
||||
let origin = ensure_signed(origin)?;
|
||||
|
||||
@@ -172,7 +172,7 @@ decl_module! {
|
||||
}
|
||||
|
||||
/// Move some assets from one holder to another.
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
#[weight = MINIMUM_WEIGHT]
|
||||
fn transfer(origin,
|
||||
#[compact] id: T::AssetId,
|
||||
target: <T::Lookup as StaticLookup>::Source,
|
||||
@@ -191,7 +191,7 @@ decl_module! {
|
||||
}
|
||||
|
||||
/// Destroy any assets of `id` owned by `origin`.
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
#[weight = MINIMUM_WEIGHT]
|
||||
fn destroy(origin, #[compact] id: T::AssetId) {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let balance = <Balances<T>>::take((id, &origin));
|
||||
|
||||
Reference in New Issue
Block a user