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

Update Weights for Vesting Pallet #5708

Merged
3 commits merged into from
Apr 29, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = MINIMUM_WEIGHT]
#[weight = 150_000_000 + T::DbWeight::get().reads_writes(2, 2)]
shawntabrizi marked this conversation as resolved.
Show resolved Hide resolved
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 = MINIMUM_WEIGHT]
#[weight = 150_000_000 + T::DbWeight::get().reads_writes(3, 3)]
shawntabrizi marked this conversation as resolved.
Show resolved Hide resolved
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
shawntabrizi marked this conversation as resolved.
Show resolved Hide resolved
/// - 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 = 1_000_000_000]
#[weight = 260_000_000 + T::DbWeight::get().reads_writes(4, 4)]
shawntabrizi marked this conversation as resolved.
Show resolved Hide resolved
pub fn vested_transfer(
origin,
target: <T::Lookup as StaticLookup>::Source,
Expand Down