mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +00:00
Weights to u64 + Balances Weights (#5446)
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -67,7 +67,7 @@ use sp_core::TypeId;
|
||||
use sp_io::hashing::blake2_256;
|
||||
use frame_support::{decl_module, decl_event, decl_error, decl_storage, Parameter, ensure, RuntimeDebug};
|
||||
use frame_support::{traits::{Get, ReservableCurrency, Currency},
|
||||
weights::{GetDispatchInfo, DispatchClass,FunctionOf},
|
||||
weights::{Weight, GetDispatchInfo, DispatchClass, FunctionOf},
|
||||
dispatch::PostDispatchInfo,
|
||||
};
|
||||
use frame_system::{self as system, ensure_signed};
|
||||
@@ -317,7 +317,7 @@ decl_module! {
|
||||
/// # </weight>
|
||||
#[weight = FunctionOf(
|
||||
|args: (&u16, &Vec<T::AccountId>, &Option<Timepoint<T::BlockNumber>>, &Box<<T as Trait>::Call>)| {
|
||||
args.3.get_dispatch_info().weight + 10_000 * (args.1.len() as u32 + 1)
|
||||
args.3.get_dispatch_info().weight + 10_000 * (args.1.len() as Weight + 1)
|
||||
},
|
||||
|args: (&u16, &Vec<T::AccountId>, &Option<Timepoint<T::BlockNumber>>, &Box<<T as Trait>::Call>)| {
|
||||
args.3.get_dispatch_info().class
|
||||
@@ -418,7 +418,7 @@ decl_module! {
|
||||
/// # </weight>
|
||||
#[weight = FunctionOf(
|
||||
|args: (&u16, &Vec<T::AccountId>, &Option<Timepoint<T::BlockNumber>>, &[u8; 32])| {
|
||||
10_000 * (args.1.len() as u32 + 1)
|
||||
10_000 * (args.1.len() as Weight + 1)
|
||||
},
|
||||
DispatchClass::Normal,
|
||||
true
|
||||
@@ -493,7 +493,7 @@ decl_module! {
|
||||
/// # </weight>
|
||||
#[weight = FunctionOf(
|
||||
|args: (&u16, &Vec<T::AccountId>, &Timepoint<T::BlockNumber>, &[u8; 32])| {
|
||||
10_000 * (args.1.len() as u32 + 1)
|
||||
10_000 * (args.1.len() as Weight + 1)
|
||||
},
|
||||
DispatchClass::Normal,
|
||||
true
|
||||
|
||||
@@ -71,6 +71,7 @@ impl frame_system::Trait for Test {
|
||||
type Event = TestEvent;
|
||||
type BlockHashCount = BlockHashCount;
|
||||
type MaximumBlockWeight = MaximumBlockWeight;
|
||||
type DbWeight = ();
|
||||
type MaximumBlockLength = MaximumBlockLength;
|
||||
type AvailableBlockRatio = AvailableBlockRatio;
|
||||
type Version = ();
|
||||
|
||||
Reference in New Issue
Block a user