Remove RefTimeWeight (#12157)

* update api

* update

* remove unused

* remove `one` api

* fix unused

* fmt

* add saturating accrue

* remove `Weight::new()`

* use some macros

* div makes no sense

* Update weight_v2.rs

* missed some

* more patch

* fixes

* more fixes

* more fix

* more fix

* remove RefTimeWeight

* Update frame/contracts/src/storage.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

* not needed

* Fixes

Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
Shawn Tabrizi
2022-09-02 19:19:49 +01:00
committed by GitHub
parent a9a2fdca7b
commit 23a81ee1e3
54 changed files with 3863 additions and 3874 deletions
+87 -87
View File
@@ -39,7 +39,7 @@
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::{RefTimeWeight, Weight, constants::RocksDbWeight}};
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use sp_std::marker::PhantomData;
/// Weight functions needed for pallet_proxy.
@@ -61,97 +61,97 @@ pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Proxy Proxies (r:1 w:0)
fn proxy(p: u32, ) -> Weight {
Weight::from_ref_time(17_768_000 as RefTimeWeight)
Weight::from_ref_time(17_768_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(76_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(76_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
// Storage: Proxy Proxies (r:1 w:0)
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn proxy_announced(a: u32, p: u32, ) -> Weight {
Weight::from_ref_time(35_682_000 as RefTimeWeight)
Weight::from_ref_time(35_682_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(158_000 as RefTimeWeight).saturating_mul(a as RefTimeWeight))
.saturating_add(Weight::from_ref_time(158_000 as u64).saturating_mul(a as u64))
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(73_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(73_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn remove_announcement(a: u32, p: u32, ) -> Weight {
Weight::from_ref_time(25_586_000 as RefTimeWeight)
Weight::from_ref_time(25_586_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(175_000 as RefTimeWeight).saturating_mul(a as RefTimeWeight))
.saturating_add(Weight::from_ref_time(175_000 as u64).saturating_mul(a as u64))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(18_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(18_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn reject_announcement(a: u32, p: u32, ) -> Weight {
Weight::from_ref_time(25_794_000 as RefTimeWeight)
Weight::from_ref_time(25_794_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(173_000 as RefTimeWeight).saturating_mul(a as RefTimeWeight))
.saturating_add(Weight::from_ref_time(173_000 as u64).saturating_mul(a as u64))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(13_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Proxy Proxies (r:1 w:0)
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn announce(a: u32, p: u32, ) -> Weight {
Weight::from_ref_time(33_002_000 as RefTimeWeight)
Weight::from_ref_time(33_002_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(163_000 as RefTimeWeight).saturating_mul(a as RefTimeWeight))
.saturating_add(Weight::from_ref_time(163_000 as u64).saturating_mul(a as u64))
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(79_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(79_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Proxy Proxies (r:1 w:1)
fn add_proxy(p: u32, ) -> Weight {
Weight::from_ref_time(28_166_000 as RefTimeWeight)
Weight::from_ref_time(28_166_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(105_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(105_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Proxy Proxies (r:1 w:1)
fn remove_proxy(p: u32, ) -> Weight {
Weight::from_ref_time(28_128_000 as RefTimeWeight)
Weight::from_ref_time(28_128_000 as u64)
// Standard Error: 3_000
.saturating_add(Weight::from_ref_time(118_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Proxy Proxies (r:1 w:1)
fn remove_proxies(p: u32, ) -> Weight {
Weight::from_ref_time(24_066_000 as RefTimeWeight)
Weight::from_ref_time(24_066_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(81_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
// Storage: Proxy Proxies (r:1 w:1)
fn anonymous(p: u32, ) -> Weight {
Weight::from_ref_time(31_077_000 as RefTimeWeight)
Weight::from_ref_time(31_077_000 as u64)
// Standard Error: 3_000
.saturating_add(Weight::from_ref_time(37_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Proxy Proxies (r:1 w:1)
fn kill_anonymous(p: u32, ) -> Weight {
Weight::from_ref_time(24_657_000 as RefTimeWeight)
Weight::from_ref_time(24_657_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(87_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(87_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
}
@@ -159,96 +159,96 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
impl WeightInfo for () {
// Storage: Proxy Proxies (r:1 w:0)
fn proxy(p: u32, ) -> Weight {
Weight::from_ref_time(17_768_000 as RefTimeWeight)
Weight::from_ref_time(17_768_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(76_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(76_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
}
// Storage: Proxy Proxies (r:1 w:0)
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn proxy_announced(a: u32, p: u32, ) -> Weight {
Weight::from_ref_time(35_682_000 as RefTimeWeight)
Weight::from_ref_time(35_682_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(158_000 as RefTimeWeight).saturating_mul(a as RefTimeWeight))
.saturating_add(Weight::from_ref_time(158_000 as u64).saturating_mul(a as u64))
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(73_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(3 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(73_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn remove_announcement(a: u32, p: u32, ) -> Weight {
Weight::from_ref_time(25_586_000 as RefTimeWeight)
Weight::from_ref_time(25_586_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(175_000 as RefTimeWeight).saturating_mul(a as RefTimeWeight))
.saturating_add(Weight::from_ref_time(175_000 as u64).saturating_mul(a as u64))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(18_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(18_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn reject_announcement(a: u32, p: u32, ) -> Weight {
Weight::from_ref_time(25_794_000 as RefTimeWeight)
Weight::from_ref_time(25_794_000 as u64)
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(173_000 as RefTimeWeight).saturating_mul(a as RefTimeWeight))
.saturating_add(Weight::from_ref_time(173_000 as u64).saturating_mul(a as u64))
// Standard Error: 1_000
.saturating_add(Weight::from_ref_time(13_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Proxy Proxies (r:1 w:0)
// Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn announce(a: u32, p: u32, ) -> Weight {
Weight::from_ref_time(33_002_000 as RefTimeWeight)
Weight::from_ref_time(33_002_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(163_000 as RefTimeWeight).saturating_mul(a as RefTimeWeight))
.saturating_add(Weight::from_ref_time(163_000 as u64).saturating_mul(a as u64))
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(79_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(3 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(79_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(3 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Proxy Proxies (r:1 w:1)
fn add_proxy(p: u32, ) -> Weight {
Weight::from_ref_time(28_166_000 as RefTimeWeight)
Weight::from_ref_time(28_166_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(105_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(105_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Proxy Proxies (r:1 w:1)
fn remove_proxy(p: u32, ) -> Weight {
Weight::from_ref_time(28_128_000 as RefTimeWeight)
Weight::from_ref_time(28_128_000 as u64)
// Standard Error: 3_000
.saturating_add(Weight::from_ref_time(118_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Proxy Proxies (r:1 w:1)
fn remove_proxies(p: u32, ) -> Weight {
Weight::from_ref_time(24_066_000 as RefTimeWeight)
Weight::from_ref_time(24_066_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(81_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
// Storage: Proxy Proxies (r:1 w:1)
fn anonymous(p: u32, ) -> Weight {
Weight::from_ref_time(31_077_000 as RefTimeWeight)
Weight::from_ref_time(31_077_000 as u64)
// Standard Error: 3_000
.saturating_add(Weight::from_ref_time(37_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Proxy Proxies (r:1 w:1)
fn kill_anonymous(p: u32, ) -> Weight {
Weight::from_ref_time(24_657_000 as RefTimeWeight)
Weight::from_ref_time(24_657_000 as u64)
// Standard Error: 2_000
.saturating_add(Weight::from_ref_time(87_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(87_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
}