mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 03:21:06 +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:
@@ -45,7 +45,6 @@ use sp_runtime::{
|
||||
use frame_support::{
|
||||
decl_module, decl_event, decl_storage, ensure, decl_error,
|
||||
traits::{Currency, EnsureOrigin, ReservableCurrency, OnUnbalanced, Get},
|
||||
weights::SimpleDispatchInfo,
|
||||
};
|
||||
use frame_system::{self as system, ensure_signed, ensure_root};
|
||||
|
||||
@@ -141,7 +140,7 @@ decl_module! {
|
||||
/// - One storage read/write.
|
||||
/// - One event.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(50_000_000)]
|
||||
#[weight = 50_000_000]
|
||||
fn set_name(origin, name: Vec<u8>) {
|
||||
let sender = ensure_signed(origin)?;
|
||||
|
||||
@@ -171,7 +170,7 @@ decl_module! {
|
||||
/// - One storage read/write.
|
||||
/// - One event.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(70_000_000)]
|
||||
#[weight = 70_000_000]
|
||||
fn clear_name(origin) {
|
||||
let sender = ensure_signed(origin)?;
|
||||
|
||||
@@ -195,7 +194,7 @@ decl_module! {
|
||||
/// - One storage read/write.
|
||||
/// - One event.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(70_000_000)]
|
||||
#[weight = 70_000_000]
|
||||
fn kill_name(origin, target: <T::Lookup as StaticLookup>::Source) {
|
||||
T::ForceOrigin::try_origin(origin)
|
||||
.map(|_| ())
|
||||
@@ -223,7 +222,7 @@ decl_module! {
|
||||
/// - One storage read/write.
|
||||
/// - One event.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(70_000_000)]
|
||||
#[weight = 70_000_000]
|
||||
fn force_name(origin, target: <T::Lookup as StaticLookup>::Source, name: Vec<u8>) {
|
||||
T::ForceOrigin::try_origin(origin)
|
||||
.map(|_| ())
|
||||
|
||||
Reference in New Issue
Block a user