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
+45 -45
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_treasury.
@@ -58,51 +58,51 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Treasury ProposalCount (r:1 w:1)
// Storage: Treasury Proposals (r:0 w:1)
fn spend() -> Weight {
Weight::from_ref_time(22_063_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
Weight::from_ref_time(22_063_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Treasury ProposalCount (r:1 w:1)
// Storage: Treasury Proposals (r:0 w:1)
fn propose_spend() -> Weight {
Weight::from_ref_time(26_473_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
Weight::from_ref_time(26_473_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Treasury Proposals (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn reject_proposal() -> Weight {
Weight::from_ref_time(29_955_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
Weight::from_ref_time(29_955_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: Treasury Proposals (r:1 w:0)
// Storage: Treasury Approvals (r:1 w:1)
fn approve_proposal(p: u32, ) -> Weight {
Weight::from_ref_time(10_786_000 as RefTimeWeight)
Weight::from_ref_time(10_786_000 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(110_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(110_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: Treasury Approvals (r:1 w:1)
fn remove_approval() -> Weight {
Weight::from_ref_time(6_647_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
Weight::from_ref_time(6_647_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: Treasury Approvals (r:1 w:1)
// Storage: Bounties BountyApprovals (r:1 w:1)
// Storage: Treasury Proposals (r:2 w:2)
// Storage: System Account (r:4 w:4)
fn on_initialize_proposals(p: u32, ) -> Weight {
Weight::from_ref_time(25_805_000 as RefTimeWeight)
Weight::from_ref_time(25_805_000 as u64)
// Standard Error: 18_000
.saturating_add(Weight::from_ref_time(28_473_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads((3 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes((3 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
.saturating_add(Weight::from_ref_time(28_473_000 as u64).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(p as u64)))
.saturating_add(T::DbWeight::get().writes(2 as u64))
.saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(p as u64)))
}
}
@@ -111,50 +111,50 @@ impl WeightInfo for () {
// Storage: Treasury ProposalCount (r:1 w:1)
// Storage: Treasury Proposals (r:0 w:1)
fn spend() -> Weight {
Weight::from_ref_time(22_063_000 as RefTimeWeight)
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
Weight::from_ref_time(22_063_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Treasury ProposalCount (r:1 w:1)
// Storage: Treasury Proposals (r:0 w:1)
fn propose_spend() -> Weight {
Weight::from_ref_time(26_473_000 as RefTimeWeight)
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
Weight::from_ref_time(26_473_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Treasury Proposals (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn reject_proposal() -> Weight {
Weight::from_ref_time(29_955_000 as RefTimeWeight)
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
Weight::from_ref_time(29_955_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
}
// Storage: Treasury Proposals (r:1 w:0)
// Storage: Treasury Approvals (r:1 w:1)
fn approve_proposal(p: u32, ) -> Weight {
Weight::from_ref_time(10_786_000 as RefTimeWeight)
Weight::from_ref_time(10_786_000 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(110_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(110_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: Treasury Approvals (r:1 w:1)
fn remove_approval() -> Weight {
Weight::from_ref_time(6_647_000 as RefTimeWeight)
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
Weight::from_ref_time(6_647_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: Treasury Approvals (r:1 w:1)
// Storage: Bounties BountyApprovals (r:1 w:1)
// Storage: Treasury Proposals (r:2 w:2)
// Storage: System Account (r:4 w:4)
fn on_initialize_proposals(p: u32, ) -> Weight {
Weight::from_ref_time(25_805_000 as RefTimeWeight)
Weight::from_ref_time(25_805_000 as u64)
// Standard Error: 18_000
.saturating_add(Weight::from_ref_time(28_473_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads((3 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes((3 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
.saturating_add(Weight::from_ref_time(28_473_000 as u64).saturating_mul(p as u64))
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().reads((3 as u64).saturating_mul(p as u64)))
.saturating_add(RocksDbWeight::get().writes(2 as u64))
.saturating_add(RocksDbWeight::get().writes((3 as u64).saturating_mul(p as u64)))
}
}