Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
6b35ac6f
Commit
6b35ac6f
authored
5 years ago
by
Shawn Tabrizi
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update Weights for Vesting Pallet (#5708)
* Update vesting weights * Update weight numbers
parent
d9d80dff
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/frame/vesting/src/lib.rs
+19
-12
19 additions, 12 deletions
substrate/frame/vesting/src/lib.rs
with
19 additions
and
12 deletions
substrate/frame/vesting/src/lib.rs
+
19
−
12
View file @
6b35ac6f
...
...
@@ -190,11 +190,13 @@ 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)
/// - Assuming less than 50 locks on any user, else we may want factor in number of locks.
/// # </weight>
#[weight
=
0
]
#[weight
=
150_000_000
+
T::DbWeight::get()
.
reads_writes(
2
,
2
)
]
fn
vest
(
origin
)
->
DispatchResult
{
let
who
=
ensure_signed
(
origin
)
?
;
Self
::
update_lock
(
who
)
...
...
@@ -211,12 +213,13 @@ 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)
/// - Assuming less than 50 locks on any user, else we may want factor in number of locks.
/// # </weight>
#[weight
=
0
]
#[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
)
?
)
...
...
@@ -233,10 +236,14 @@ 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)
/// - Assuming less than 50 locks on any user, else we may want factor in number of locks.
/// # </weight>
#[weight
=
1_0
00_000_000
]
#[weight
=
3
00_000_000
+
T::DbWeight::get()
.
reads_writes(
3
,
3
)
]
pub
fn
vested_transfer
(
origin
,
target
:
<
T
::
Lookup
as
StaticLookup
>
::
Source
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment