-
Notifications
You must be signed in to change notification settings - Fork 398
/
Copy pathpallet_dapps_staking.rs
123 lines (117 loc) · 4.44 KB
/
pallet_dapps_staking.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//! Autogenerated weights for `pallet_dapps_staking`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-11-30, STEPS: `20`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("shibuya-dev"), DB CACHE: 128
// Executed Command:
// ./target/release/astar-collator
// benchmark
// --chain
// shibuya-dev
// --execution
// wasm
// --wasm-execution
// compiled
// --pallet
// pallet_dapps_staking
// --steps
// 20
// --repeat
// 10
// --extrinsic
// *
// --output
// .
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for `pallet_dapps_staking`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_dapps_staking::WeightInfo for WeightInfo<T> {
// Storage: DappsStaking RegisteredDevelopers (r:1 w:1)
// Storage: DappsStaking RegisteredDapps (r:1 w:1)
// Storage: DappsStaking PreApprovalIsEnabled (r:1 w:0)
fn register() -> Weight {
(39_675_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: DappsStaking RegisteredDevelopers (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:3 w:1)
// Storage: DappsStaking EraRewardsAndStakes (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: DappsStaking Ledger (r:102 w:102)
// Storage: Balances Locks (r:102 w:102)
fn unregister(n: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 151_000
.saturating_add((32_377_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight)))
}
// Storage: DappsStaking PreApprovalIsEnabled (r:0 w:1)
fn enable_developer_pre_approval() -> Weight {
(1_733_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: DappsStaking PreApprovedDevelopers (r:1 w:1)
fn developer_pre_approval() -> Weight {
(6_479_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking RegisteredDevelopers (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking EraRewardsAndStakes (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn bond_and_stake() -> Weight {
(565_294_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking RegisteredDevelopers (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: DappsStaking EraRewardsAndStakes (r:1 w:1)
fn unbond_and_unstake() -> Weight {
(631_899_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
fn withdraw_unbonded() -> Weight {
(96_573_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking EraRewardsAndStakes (r:1 w:0)
// Storage: Balances TotalIssuance (r:1 w:1)
fn claim(n: u32, ) -> Weight {
(109_775_000 as Weight)
// Standard Error: 9_000
.saturating_add((5_226_000 as Weight).saturating_mul(n as Weight))
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: DappsStaking ForceEra (r:0 w:1)
fn force_new_era() -> Weight {
(2_305_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}