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
@@ -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_state_trie_migration.
@@ -59,40 +59,40 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: StateTrieMigration SignedMigrationMaxLimits (r:1 w:0)
// Storage: StateTrieMigration MigrationProcess (r:1 w:1)
fn continue_migrate() -> Weight {
Weight::from_ref_time(19_019_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
Weight::from_ref_time(19_019_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: StateTrieMigration SignedMigrationMaxLimits (r:1 w:0)
fn continue_migrate_wrong_witness() -> Weight {
Weight::from_ref_time(1_874_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
Weight::from_ref_time(1_874_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
}
fn migrate_custom_top_success() -> Weight {
Weight::from_ref_time(16_381_000 as RefTimeWeight)
Weight::from_ref_time(16_381_000 as u64)
}
// Storage: unknown [0x666f6f] (r:1 w:1)
fn migrate_custom_top_fail() -> Weight {
Weight::from_ref_time(25_966_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(25_966_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
fn migrate_custom_child_success() -> Weight {
Weight::from_ref_time(16_712_000 as RefTimeWeight)
Weight::from_ref_time(16_712_000 as u64)
}
// Storage: unknown [0x666f6f] (r:1 w:1)
fn migrate_custom_child_fail() -> Weight {
Weight::from_ref_time(29_885_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(29_885_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: unknown [0x6b6579] (r:1 w:1)
fn process_top_key(v: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
Weight::from_ref_time(0 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).saturating_mul(v 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(2_000 as u64).saturating_mul(v as u64))
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
}
@@ -101,39 +101,39 @@ impl WeightInfo for () {
// Storage: StateTrieMigration SignedMigrationMaxLimits (r:1 w:0)
// Storage: StateTrieMigration MigrationProcess (r:1 w:1)
fn continue_migrate() -> Weight {
Weight::from_ref_time(19_019_000 as RefTimeWeight)
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
Weight::from_ref_time(19_019_000 as u64)
.saturating_add(RocksDbWeight::get().reads(2 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: StateTrieMigration SignedMigrationMaxLimits (r:1 w:0)
fn continue_migrate_wrong_witness() -> Weight {
Weight::from_ref_time(1_874_000 as RefTimeWeight)
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
Weight::from_ref_time(1_874_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
}
fn migrate_custom_top_success() -> Weight {
Weight::from_ref_time(16_381_000 as RefTimeWeight)
Weight::from_ref_time(16_381_000 as u64)
}
// Storage: unknown [0x666f6f] (r:1 w:1)
fn migrate_custom_top_fail() -> Weight {
Weight::from_ref_time(25_966_000 as RefTimeWeight)
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
Weight::from_ref_time(25_966_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
fn migrate_custom_child_success() -> Weight {
Weight::from_ref_time(16_712_000 as RefTimeWeight)
Weight::from_ref_time(16_712_000 as u64)
}
// Storage: unknown [0x666f6f] (r:1 w:1)
fn migrate_custom_child_fail() -> Weight {
Weight::from_ref_time(29_885_000 as RefTimeWeight)
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
Weight::from_ref_time(29_885_000 as u64)
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
// Storage: unknown [0x6b6579] (r:1 w:1)
fn process_top_key(v: u32, ) -> Weight {
Weight::from_ref_time(0 as RefTimeWeight)
Weight::from_ref_time(0 as u64)
// Standard Error: 0
.saturating_add(Weight::from_ref_time(2_000 as RefTimeWeight).saturating_mul(v as RefTimeWeight))
.saturating_add(RocksDbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(RocksDbWeight::get().writes(1 as RefTimeWeight))
.saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(v as u64))
.saturating_add(RocksDbWeight::get().reads(1 as u64))
.saturating_add(RocksDbWeight::get().writes(1 as u64))
}
}