mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
Weights to u64 + Balances Weights (#5446)
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -52,13 +52,14 @@
|
||||
//!
|
||||
//! ```
|
||||
//! use frame_support::{decl_module, dispatch};
|
||||
//! use frame_support::weights::{SimpleDispatchInfo, MINIMUM_WEIGHT};
|
||||
//! use frame_system::{self as system, ensure_root};
|
||||
//!
|
||||
//! pub trait Trait: frame_system::Trait {}
|
||||
//!
|
||||
//! decl_module! {
|
||||
//! pub struct Module<T: Trait> for enum Call where origin: T::Origin {
|
||||
//! #[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
//! #[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
//! pub fn privileged_function(origin) -> dispatch::DispatchResult {
|
||||
//! ensure_root(origin)?;
|
||||
//!
|
||||
@@ -92,7 +93,7 @@ use sp_runtime::traits::{StaticLookup, Dispatchable};
|
||||
use frame_support::{
|
||||
Parameter, decl_module, decl_event, decl_storage, decl_error, ensure,
|
||||
};
|
||||
use frame_support::weights::{GetDispatchInfo, FunctionOf};
|
||||
use frame_support::weights::{SimpleDispatchInfo, MINIMUM_WEIGHT, GetDispatchInfo, FunctionOf};
|
||||
use frame_system::{self as system, ensure_signed};
|
||||
|
||||
pub trait Trait: frame_system::Trait {
|
||||
@@ -150,7 +151,7 @@ decl_module! {
|
||||
/// - Limited storage reads.
|
||||
/// - One DB change.
|
||||
/// # </weight>
|
||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
|
||||
fn set_key(origin, new: <T::Lookup as StaticLookup>::Source) {
|
||||
// This is a public call, so we ensure that the origin is some signed account.
|
||||
let sender = ensure_signed(origin)?;
|
||||
|
||||
Reference in New Issue
Block a user