pallet_staking.rs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. // This file is part of Substrate.
  2. // Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
  3. // SPDX-License-Identifier: Apache-2.0
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //! Default weights of pallet-staking.
  16. //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc6
  17. #![allow(unused_parens)]
  18. #![allow(unused_imports)]
  19. use frame_support::weights::{constants::RocksDbWeight as DbWeight, Weight};
  20. pub struct WeightInfo;
  21. impl pallet_staking::WeightInfo for WeightInfo {
  22. fn bond() -> Weight {
  23. (144278000 as Weight)
  24. .saturating_add(DbWeight::get().reads(5 as Weight))
  25. .saturating_add(DbWeight::get().writes(4 as Weight))
  26. }
  27. fn bond_extra() -> Weight {
  28. (110715000 as Weight)
  29. .saturating_add(DbWeight::get().reads(4 as Weight))
  30. .saturating_add(DbWeight::get().writes(2 as Weight))
  31. }
  32. fn unbond() -> Weight {
  33. (99840000 as Weight)
  34. .saturating_add(DbWeight::get().reads(5 as Weight))
  35. .saturating_add(DbWeight::get().writes(3 as Weight))
  36. }
  37. fn withdraw_unbonded_update(s: u32) -> Weight {
  38. (100728000 as Weight)
  39. .saturating_add((63000 as Weight).saturating_mul(s as Weight))
  40. .saturating_add(DbWeight::get().reads(5 as Weight))
  41. .saturating_add(DbWeight::get().writes(3 as Weight))
  42. }
  43. fn withdraw_unbonded_kill(s: u32) -> Weight {
  44. (168879000 as Weight)
  45. .saturating_add((6666000 as Weight).saturating_mul(s as Weight))
  46. .saturating_add(DbWeight::get().reads(7 as Weight))
  47. .saturating_add(DbWeight::get().writes(8 as Weight))
  48. .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
  49. }
  50. fn validate() -> Weight {
  51. (35539000 as Weight)
  52. .saturating_add(DbWeight::get().reads(2 as Weight))
  53. .saturating_add(DbWeight::get().writes(2 as Weight))
  54. }
  55. fn nominate(n: u32) -> Weight {
  56. (48596000 as Weight)
  57. .saturating_add((308000 as Weight).saturating_mul(n as Weight))
  58. .saturating_add(DbWeight::get().reads(3 as Weight))
  59. .saturating_add(DbWeight::get().writes(2 as Weight))
  60. }
  61. fn chill() -> Weight {
  62. (35144000 as Weight)
  63. .saturating_add(DbWeight::get().reads(2 as Weight))
  64. .saturating_add(DbWeight::get().writes(2 as Weight))
  65. }
  66. fn set_payee() -> Weight {
  67. (24255000 as Weight)
  68. .saturating_add(DbWeight::get().reads(1 as Weight))
  69. .saturating_add(DbWeight::get().writes(1 as Weight))
  70. }
  71. fn set_controller() -> Weight {
  72. (52294000 as Weight)
  73. .saturating_add(DbWeight::get().reads(3 as Weight))
  74. .saturating_add(DbWeight::get().writes(3 as Weight))
  75. }
  76. fn set_validator_count() -> Weight {
  77. (5185000 as Weight).saturating_add(DbWeight::get().writes(1 as Weight))
  78. }
  79. fn force_no_eras() -> Weight {
  80. (5907000 as Weight).saturating_add(DbWeight::get().writes(1 as Weight))
  81. }
  82. fn force_new_era() -> Weight {
  83. (5917000 as Weight).saturating_add(DbWeight::get().writes(1 as Weight))
  84. }
  85. fn force_new_era_always() -> Weight {
  86. (5952000 as Weight).saturating_add(DbWeight::get().writes(1 as Weight))
  87. }
  88. fn set_invulnerables(v: u32) -> Weight {
  89. (6324000 as Weight)
  90. .saturating_add((9000 as Weight).saturating_mul(v as Weight))
  91. .saturating_add(DbWeight::get().writes(1 as Weight))
  92. }
  93. fn force_unstake(s: u32) -> Weight {
  94. (119691000 as Weight)
  95. .saturating_add((6681000 as Weight).saturating_mul(s as Weight))
  96. .saturating_add(DbWeight::get().reads(4 as Weight))
  97. .saturating_add(DbWeight::get().writes(8 as Weight))
  98. .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
  99. }
  100. fn cancel_deferred_slash(s: u32) -> Weight {
  101. (5820201000 as Weight)
  102. .saturating_add((34672000 as Weight).saturating_mul(s as Weight))
  103. .saturating_add(DbWeight::get().reads(1 as Weight))
  104. .saturating_add(DbWeight::get().writes(1 as Weight))
  105. }
  106. fn payout_stakers_dead_controller(n: u32) -> Weight {
  107. (0 as Weight)
  108. .saturating_add((92486000 as Weight).saturating_mul(n as Weight))
  109. .saturating_add(DbWeight::get().reads(4 as Weight))
  110. .saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
  111. .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(n as Weight)))
  112. }
  113. fn payout_stakers_alive_staked(n: u32) -> Weight {
  114. (0 as Weight)
  115. .saturating_add((117324000 as Weight).saturating_mul(n as Weight))
  116. .saturating_add(DbWeight::get().reads((5 as Weight).saturating_mul(n as Weight)))
  117. .saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(n as Weight)))
  118. }
  119. fn rebond(l: u32) -> Weight {
  120. (71316000 as Weight)
  121. .saturating_add((142000 as Weight).saturating_mul(l as Weight))
  122. .saturating_add(DbWeight::get().reads(4 as Weight))
  123. .saturating_add(DbWeight::get().writes(3 as Weight))
  124. }
  125. fn set_history_depth(e: u32) -> Weight {
  126. (0 as Weight)
  127. .saturating_add((51901000 as Weight).saturating_mul(e as Weight))
  128. .saturating_add(DbWeight::get().reads(2 as Weight))
  129. .saturating_add(DbWeight::get().writes(4 as Weight))
  130. .saturating_add(DbWeight::get().writes((7 as Weight).saturating_mul(e as Weight)))
  131. }
  132. fn reap_stash(s: u32) -> Weight {
  133. (147166000 as Weight)
  134. .saturating_add((6661000 as Weight).saturating_mul(s as Weight))
  135. .saturating_add(DbWeight::get().reads(4 as Weight))
  136. .saturating_add(DbWeight::get().writes(8 as Weight))
  137. .saturating_add(DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
  138. }
  139. fn new_era(v: u32, n: u32) -> Weight {
  140. (0 as Weight)
  141. .saturating_add((1440459000 as Weight).saturating_mul(v as Weight))
  142. .saturating_add((182580000 as Weight).saturating_mul(n as Weight))
  143. .saturating_add(DbWeight::get().reads(10 as Weight))
  144. .saturating_add(DbWeight::get().reads((4 as Weight).saturating_mul(v as Weight)))
  145. .saturating_add(DbWeight::get().reads((3 as Weight).saturating_mul(n as Weight)))
  146. .saturating_add(DbWeight::get().writes(8 as Weight))
  147. .saturating_add(DbWeight::get().writes((3 as Weight).saturating_mul(v as Weight)))
  148. }
  149. fn submit_solution_better(v: u32, n: u32, a: u32, w: u32) -> Weight {
  150. (0 as Weight)
  151. .saturating_add((964000 as Weight).saturating_mul(v as Weight))
  152. .saturating_add((432000 as Weight).saturating_mul(n as Weight))
  153. .saturating_add((204294000 as Weight).saturating_mul(a as Weight))
  154. .saturating_add((9546000 as Weight).saturating_mul(w as Weight))
  155. .saturating_add(DbWeight::get().reads(6 as Weight))
  156. .saturating_add(DbWeight::get().reads((4 as Weight).saturating_mul(a as Weight)))
  157. .saturating_add(DbWeight::get().reads((1 as Weight).saturating_mul(w as Weight)))
  158. .saturating_add(DbWeight::get().writes(2 as Weight))
  159. }
  160. }