mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 18:15:48 +00:00
Weight v1.5: Opaque Struct (#12138)
* initial idea * update frame_support * update a bunch more * add ord * adjust RuntimeDbWeight * frame_system builds * re-export * frame_support tests pass * frame_executive compile * frame_executive builds * frame_system tests passing * pallet-utility tests pass * fix a bunch of pallets * more * phragmen * state-trie-migration * scheduler and referenda * pallet-election-provider-multi-phase * aura * staking * more * babe * balances * bunch more * sudo * transaction-payment * asset-tx-payment * last pallets * fix alliance merge * fix node template runtime * fix pallet-contracts cc @athei * fix node runtime * fix compile on runtime-benchmarks feature * comment * fix frame-support-test * fix more tests * weight regex * frame system works * fix a bunch * more * more * more * more * more * more fixes * update templates * fix contracts benchmarks * Update lib.rs * Update lib.rs * fix ui * make scalar saturating mul const * more const functions * scalar div * refactor using constant functions * move impl * fix overhead template * use compactas * Update lib.rs
This commit is contained in:
@@ -45,7 +45,7 @@ frame_support::construct_runtime!(
|
||||
|
||||
parameter_types! {
|
||||
pub BlockWeights: frame_system::limits::BlockWeights =
|
||||
frame_system::limits::BlockWeights::simple_max(1024);
|
||||
frame_system::limits::BlockWeights::simple_max(frame_support::weights::Weight::from_ref_time(1024));
|
||||
}
|
||||
impl frame_system::Config for Test {
|
||||
type AccountData = pallet_balances::AccountData<u64>;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use frame_support::{traits::Get, weights::{RefTimeWeight, Weight, constants::RocksDbWeight}};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for pallet_vesting.
|
||||
@@ -60,96 +60,96 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
fn vest_locked(l: u32, s: u32, ) -> Weight {
|
||||
(32_978_000 as Weight)
|
||||
Weight::from_ref_time(32_978_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((82_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(82_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((88_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(88_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
fn vest_unlocked(l: u32, s: u32, ) -> Weight {
|
||||
(32_856_000 as Weight)
|
||||
Weight::from_ref_time(32_856_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((79_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(79_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((56_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(56_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
|
||||
(33_522_000 as Weight)
|
||||
Weight::from_ref_time(33_522_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((74_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(74_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((72_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(72_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
|
||||
(32_558_000 as Weight)
|
||||
Weight::from_ref_time(32_558_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((78_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(78_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((61_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(61_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
fn vested_transfer(l: u32, s: u32, ) -> Weight {
|
||||
(49_260_000 as Weight)
|
||||
Weight::from_ref_time(49_260_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((80_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(80_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((55_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(55_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: System Account (r:2 w:2)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
fn force_vested_transfer(l: u32, s: u32, ) -> Weight {
|
||||
(49_166_000 as Weight)
|
||||
Weight::from_ref_time(49_166_000 as RefTimeWeight)
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((77_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(77_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 4_000
|
||||
.saturating_add((43_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(43_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
|
||||
(34_042_000 as Weight)
|
||||
Weight::from_ref_time(34_042_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((83_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(83_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((80_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(80_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
|
||||
(33_937_000 as Weight)
|
||||
Weight::from_ref_time(33_937_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((78_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(78_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((73_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(73_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,95 +158,95 @@ impl WeightInfo for () {
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
fn vest_locked(l: u32, s: u32, ) -> Weight {
|
||||
(32_978_000 as Weight)
|
||||
Weight::from_ref_time(32_978_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((82_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(82_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((88_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(88_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
fn vest_unlocked(l: u32, s: u32, ) -> Weight {
|
||||
(32_856_000 as Weight)
|
||||
Weight::from_ref_time(32_856_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((79_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(79_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((56_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(56_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(2 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(2 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn vest_other_locked(l: u32, s: u32, ) -> Weight {
|
||||
(33_522_000 as Weight)
|
||||
Weight::from_ref_time(33_522_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((74_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(74_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((72_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(72_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn vest_other_unlocked(l: u32, s: u32, ) -> Weight {
|
||||
(32_558_000 as Weight)
|
||||
Weight::from_ref_time(32_558_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((78_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(78_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((61_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(61_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
fn vested_transfer(l: u32, s: u32, ) -> Weight {
|
||||
(49_260_000 as Weight)
|
||||
Weight::from_ref_time(49_260_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((80_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(80_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 3_000
|
||||
.saturating_add((55_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(55_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: System Account (r:2 w:2)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
fn force_vested_transfer(l: u32, s: u32, ) -> Weight {
|
||||
(49_166_000 as Weight)
|
||||
Weight::from_ref_time(49_166_000 as RefTimeWeight)
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((77_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(77_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 4_000
|
||||
.saturating_add((43_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(4 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(4 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(43_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(4 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(4 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
|
||||
(34_042_000 as Weight)
|
||||
Weight::from_ref_time(34_042_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((83_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(83_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((80_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(80_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
// Storage: Vesting Vesting (r:1 w:1)
|
||||
// Storage: Balances Locks (r:1 w:1)
|
||||
// Storage: System Account (r:1 w:1)
|
||||
fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight {
|
||||
(33_937_000 as Weight)
|
||||
Weight::from_ref_time(33_937_000 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add((78_000 as Weight).saturating_mul(l as Weight))
|
||||
.saturating_add(Weight::from_ref_time(78_000 as RefTimeWeight).scalar_saturating_mul(l as RefTimeWeight))
|
||||
// Standard Error: 2_000
|
||||
.saturating_add((73_000 as Weight).saturating_mul(s as Weight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as Weight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as Weight))
|
||||
.saturating_add(Weight::from_ref_time(73_000 as RefTimeWeight).scalar_saturating_mul(s as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().reads(3 as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as RefTimeWeight))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user