mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 21:41:02 +00:00
Weights to u64 + Balances Weights (#5446)
Co-Authored-By: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -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 = ();
|
||||
|
||||
Reference in New Issue
Block a user