Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion PR for #7138 (WeightInfo for Scheduler) #1734

Merged
2 commits merged into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
270 changes: 136 additions & 134 deletions Cargo.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,19 @@ impl frame_system::Trait for Runtime {
type SystemWeightInfo = weights::frame_system::WeightInfo;
}

parameter_types! {
pub const MaxScheduledPerBlock: u32 = 50;
}

impl pallet_scheduler::Trait for Runtime {
type Event = Event;
type Origin = Origin;
type PalletsOrigin = OriginCaller;
type Call = Call;
type MaximumWeight = MaximumBlockWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = weights::pallet_scheduler::WeightInfo;
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions runtime/kusama/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub mod pallet_balances;
pub mod pallet_collective;
pub mod pallet_democracy;
pub mod pallet_proxy;
pub mod pallet_scheduler;
pub mod pallet_staking;
pub mod pallet_timestamp;
pub mod pallet_treasury;
Expand Down
49 changes: 49 additions & 0 deletions runtime/kusama/src/weights/pallet_scheduler.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc6
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};

pub struct WeightInfo;
impl pallet_scheduler::WeightInfo for WeightInfo {
fn schedule(s: u32, ) -> Weight {
(37_835_000 as Weight)
.saturating_add((81_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(1 as Weight))
}
fn cancel(s: u32, ) -> Weight {
(34_707_000 as Weight)
.saturating_add((3_125_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn schedule_named(s: u32, ) -> Weight {
(48_065_000 as Weight)
.saturating_add((110_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn cancel_named(s: u32, ) -> Weight {
(38_776_000 as Weight)
.saturating_add((3_138_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
}
7 changes: 6 additions & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,19 @@ impl frame_system::Trait for Runtime {
type SystemWeightInfo = weights::frame_system::WeightInfo;
}

parameter_types! {
pub const MaxScheduledPerBlock: u32 = 50;
}

impl pallet_scheduler::Trait for Runtime {
type Event = Event;
type Origin = Origin;
type PalletsOrigin = OriginCaller;
type Call = Call;
type MaximumWeight = MaximumBlockWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = weights::pallet_scheduler::WeightInfo;
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions runtime/polkadot/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub mod pallet_balances;
pub mod pallet_collective;
pub mod pallet_democracy;
pub mod pallet_proxy;
pub mod pallet_scheduler;
pub mod pallet_staking;
pub mod pallet_timestamp;
pub mod pallet_treasury;
Expand Down
49 changes: 49 additions & 0 deletions runtime/polkadot/src/weights/pallet_scheduler.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc6
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};

pub struct WeightInfo;
impl pallet_scheduler::WeightInfo for WeightInfo {
fn schedule(s: u32, ) -> Weight {
(37_835_000 as Weight)
.saturating_add((81_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(1 as Weight))
}
fn cancel(s: u32, ) -> Weight {
(34_707_000 as Weight)
.saturating_add((3_125_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn schedule_named(s: u32, ) -> Weight {
(48_065_000 as Weight)
.saturating_add((110_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn cancel_named(s: u32, ) -> Weight {
(38_776_000 as Weight)
.saturating_add((3_138_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
}
7 changes: 6 additions & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,19 @@ impl frame_system::Trait for Runtime {
type SystemWeightInfo = weights::frame_system::WeightInfo;
}

parameter_types! {
pub const MaxScheduledPerBlock: u32 = 50;
}

impl pallet_scheduler::Trait for Runtime {
type Event = Event;
type Origin = Origin;
type PalletsOrigin = OriginCaller;
type Call = Call;
type MaximumWeight = MaximumBlockWeight;
type ScheduleOrigin = EnsureRoot<AccountId>;
type WeightInfo = ();
type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = weights::pallet_scheduler::WeightInfo;
}

parameter_types! {
Expand Down
1 change: 1 addition & 0 deletions runtime/westend/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
pub mod frame_system;
pub mod pallet_balances;
pub mod pallet_proxy;
pub mod pallet_scheduler;
pub mod pallet_staking;
pub mod pallet_timestamp;
pub mod pallet_utility;
49 changes: 49 additions & 0 deletions runtime/westend/src/weights/pallet_scheduler.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 2.0.0-rc6
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::weights::{Weight, constants::RocksDbWeight as DbWeight};

pub struct WeightInfo;
impl pallet_scheduler::WeightInfo for WeightInfo {
fn schedule(s: u32, ) -> Weight {
(37_835_000 as Weight)
.saturating_add((81_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(1 as Weight))
}
fn cancel(s: u32, ) -> Weight {
(34_707_000 as Weight)
.saturating_add((3_125_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(1 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn schedule_named(s: u32, ) -> Weight {
(48_065_000 as Weight)
.saturating_add((110_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
fn cancel_named(s: u32, ) -> Weight {
(38_776_000 as Weight)
.saturating_add((3_138_000 as Weight).saturating_mul(s as Weight))
.saturating_add(DbWeight::get().reads(2 as Weight))
.saturating_add(DbWeight::get().writes(2 as Weight))
}
}