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
+5 -4
View File
@@ -57,7 +57,7 @@ use frame_support::traits::{
Currency, LockableCurrency, VestingSchedule, WithdrawReason, LockIdentifier,
ExistenceRequirement, Get
};
use frame_support::weights::SimpleDispatchInfo;
use frame_support::weights::{SimpleDispatchInfo, MINIMUM_WEIGHT};
use frame_system::{self as system, ensure_signed};
mod benchmarking;
@@ -194,7 +194,7 @@ decl_module! {
/// - One storage read (codec `O(1)`) and up to one removal.
/// - One event.
/// # </weight>
#[weight = SimpleDispatchInfo::default()]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn vest(origin) -> DispatchResult {
let who = ensure_signed(origin)?;
Self::update_lock(who)
@@ -216,7 +216,7 @@ decl_module! {
/// - One storage read (codec `O(1)`) and up to one removal.
/// - One event.
/// # </weight>
#[weight = SimpleDispatchInfo::default()]
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
fn vest_other(origin, target: <T::Lookup as StaticLookup>::Source) -> DispatchResult {
ensure_signed(origin)?;
Self::update_lock(T::Lookup::lookup(target)?)
@@ -236,7 +236,7 @@ decl_module! {
/// - Creates a new storage entry, but is protected by a minimum transfer
/// amount needed to succeed.
/// # </weight>
#[weight = SimpleDispatchInfo::FixedNormal(1_000_000)]
#[weight = SimpleDispatchInfo::FixedNormal(1_000_000_000)]
pub fn vested_transfer(
origin,
target: <T::Lookup as StaticLookup>::Source,
@@ -381,6 +381,7 @@ mod tests {
type Event = ();
type BlockHashCount = BlockHashCount;
type MaximumBlockWeight = MaximumBlockWeight;
type DbWeight = ();
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();