Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Update Vesting Weights
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntabrizi committed Apr 20, 2020
1 parent eda9d32 commit d4186f7
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions frame/vesting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,12 @@ decl_module! {
///
/// # <weight>
/// - `O(1)`.
/// - One balance-lock operation.
/// - One storage read (codec `O(1)`) and up to one removal.
/// - One event.
/// - DbWeight: 2 Reads, 2 Writes
/// - Reads: Vesting Storage, Balances Locks, [Sender Account]
/// - Writes: Vesting Storage, Balances Locks, [Sender Account]
/// - Benchmark: 147.5 µs (min square analysis)
/// # </weight>
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = 150_000_000 + T::DbWeight::get().reads_writes(2, 2)]
fn vest(origin) -> DispatchResult {
let who = ensure_signed(origin)?;
Self::update_lock(who)
Expand All @@ -211,12 +212,12 @@ decl_module! {
///
/// # <weight>
/// - `O(1)`.
/// - Up to one account lookup.
/// - One balance-lock operation.
/// - One storage read (codec `O(1)`) and up to one removal.
/// - One event.
/// - DbWeight: 3 Reads, 3 Writes
/// - Reads: Vesting Storage, Balances Locks, Target Account
/// - Writes: Vesting Storage, Balances Locks, Target Account
/// - Benchmark: 150.4 µs (min square analysis)
/// # </weight>
#[weight = SimpleDispatchInfo::FixedNormal(MINIMUM_WEIGHT)]
#[weight = 150_000_000 + T::DbWeight::get().reads_writes(3, 3)]
fn vest_other(origin, target: <T::Lookup as StaticLookup>::Source) -> DispatchResult {
ensure_signed(origin)?;
Self::update_lock(T::Lookup::lookup(target)?)
Expand All @@ -233,10 +234,13 @@ decl_module! {
/// Emits `VestingCreated`.
///
/// # <weight>
/// - Creates a new storage entry, but is protected by a minimum transfer
/// amount needed to succeed.
/// - `O(1)`.
/// - DbWeight: 3 Reads, 3 Writes
/// - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]
/// - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]
/// - Benchmark: 263 µs (min square analysis)
/// # </weight>
#[weight = SimpleDispatchInfo::FixedNormal(1_000_000_000)]
#[weight = 260_000_000 + T::DbWeight::get().reads_writes(4, 4)]
pub fn vested_transfer(
origin,
target: <T::Lookup as StaticLookup>::Source,
Expand Down

0 comments on commit d4186f7

Please sign in to comment.