Companion for Weight v1.5 (#1581)

* cargo test -p cumulus-primitives-utility

* cargo test -p cumulus-pallet-xcmp-queue

* cargo test -p cumulus-pallet-xcm

* cargo test -p cumulus-pallet-dmp-queue

* cargo test -p pallet-template

* cargo test -p cumulus-test-runtime

* fix weights

* fix more weights

* cargo test -p parachains-common

* cargo test -p parachain-template-runtime

* fix weights import

* cargo test -p collectives-polkadot-runtime

* cargo test -p contracts-rococo-runtime

* more

* unused

* fixes

* Update benchmarking.rs

* Update lib.rs

* Update lib.rs

* fix

* fix bug in conversion

* update lockfile for {"polkadot", "substrate"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Shawn Tabrizi
2022-08-31 13:24:42 +01:00
committed by GitHub
parent 6165597eb7
commit 48d4f1c57d
118 changed files with 2005 additions and 1885 deletions
@@ -40,7 +40,7 @@
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use frame_support::{traits::Get, weights::{RefTimeWeight, Weight}};
use sp_std::marker::PhantomData;
/// Weight functions for `pallet_assets`.
@@ -48,15 +48,15 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
// Storage: Assets Asset (r:1 w:1)
fn create() -> Weight {
(26_670_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(26_670_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
fn force_create() -> Weight {
(15_063_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(15_063_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:5002 w:5001)
@@ -67,165 +67,165 @@ impl<T: frame_system::Config> pallet_assets::WeightInfo for WeightInfo<T> {
/// The range of component `s` is `[0, 5000]`.
/// The range of component `a` is `[0, 500]`.
fn destroy(c: u32, s: u32, a: u32, ) -> Weight {
(0 as Weight)
Weight::from_ref_time(0 as RefTimeWeight)
// Standard Error: 46_000
.saturating_add((16_382_000 as Weight).saturating_mul(c as Weight))
.saturating_add(Weight::from_ref_time(16_382_000 as RefTimeWeight).scalar_saturating_mul(c as RefTimeWeight))
// Standard Error: 46_000
.saturating_add((19_187_000 as Weight).saturating_mul(s as Weight))
.saturating_add(Weight::from_ref_time(19_187_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
// Standard Error: 465_000
.saturating_add((16_818_000 as Weight).saturating_mul(a as Weight))
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(c as Weight)))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(a as Weight)))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(c as Weight)))
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight)))
.saturating_add(Weight::from_ref_time(16_818_000 as RefTimeWeight).scalar_saturating_mul(a as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads(5 as RefTimeWeight))
.saturating_add(T::DbWeight::get().reads((2 as RefTimeWeight).saturating_mul(c as RefTimeWeight)))
.saturating_add(T::DbWeight::get().reads((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
.saturating_add(T::DbWeight::get().reads((1 as RefTimeWeight).saturating_mul(a as RefTimeWeight)))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes((2 as RefTimeWeight).saturating_mul(c as RefTimeWeight)))
.saturating_add(T::DbWeight::get().writes((2 as RefTimeWeight).saturating_mul(s as RefTimeWeight)))
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(a as RefTimeWeight)))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:1 w:1)
fn mint() -> Weight {
(29_655_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
Weight::from_ref_time(29_655_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:1 w:1)
fn burn() -> Weight {
(33_648_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
Weight::from_ref_time(33_648_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
(47_414_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
Weight::from_ref_time(47_414_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(4 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
(39_871_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
Weight::from_ref_time(39_871_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(4 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn force_transfer() -> Weight {
(47_454_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
Weight::from_ref_time(47_454_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(4 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(4 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Account (r:1 w:1)
fn freeze() -> Weight {
(20_827_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(20_827_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Account (r:1 w:1)
fn thaw() -> Weight {
(21_249_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(21_249_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
fn freeze_asset() -> Weight {
(17_775_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(17_775_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
fn thaw_asset() -> Weight {
(17_917_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(17_917_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Metadata (r:1 w:0)
fn transfer_ownership() -> Weight {
(18_724_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(18_724_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
fn set_team() -> Weight {
(17_448_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(17_448_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
/// The range of component `n` is `[0, 50]`.
/// The range of component `s` is `[0, 50]`.
fn set_metadata(_n: u32, _s: u32, ) -> Weight {
(31_859_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(31_859_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn clear_metadata() -> Weight {
(31_293_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(31_293_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
/// The range of component `n` is `[0, 50]`.
/// The range of component `s` is `[0, 50]`.
fn force_set_metadata(_n: u32, _s: u32, ) -> Weight {
(19_595_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(19_595_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:0)
// Storage: Assets Metadata (r:1 w:1)
fn force_clear_metadata() -> Weight {
(31_366_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(31_366_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
fn force_asset_status() -> Weight {
(16_884_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
Weight::from_ref_time(16_884_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(1 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(1 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Approvals (r:1 w:1)
fn approve_transfer() -> Weight {
(34_730_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
Weight::from_ref_time(34_730_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
}
// Storage: Assets Approvals (r:1 w:1)
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Account (r:2 w:2)
// Storage: System Account (r:1 w:1)
fn transfer_approved() -> Weight {
(59_797_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
Weight::from_ref_time(59_797_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(5 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(5 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Approvals (r:1 w:1)
fn cancel_approval() -> Weight {
(35_178_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
Weight::from_ref_time(35_178_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
}
// Storage: Assets Asset (r:1 w:1)
// Storage: Assets Approvals (r:1 w:1)
fn force_cancel_approval() -> Weight {
(36_840_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
Weight::from_ref_time(36_840_000 as RefTimeWeight)
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
}
}