Weights to u64 + Balances Weights (#5446)

Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Shawn Tabrizi
2020-04-16 10:43:18 +02:00
committed by GitHub
parent 1c7525fd4b
commit 980b635c8d
82 changed files with 636 additions and 428 deletions
+4 -4
View File
@@ -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
+1
View File
@@ -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 = ();