-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
131 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// This file is part of Substrate. | ||
|
||
// Copyright (C) 2022 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. | ||
|
||
//! Autogenerated weights for pallet_weights | ||
//! | ||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev | ||
//! DATE: 2022-11-04, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` | ||
//! HOSTNAME: ``, CPU: `` | ||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 | ||
// Executed Command: | ||
// ./target/release/node-template | ||
// benchmark | ||
// pallet | ||
// --chain | ||
// dev | ||
// --execution=wasm | ||
// --wasm-execution=compiled | ||
// --pallet | ||
// pallet_weights | ||
// --extrinsic | ||
// * | ||
// --steps | ||
// 50 | ||
// --repeat | ||
// 20 | ||
// --template=./.maintain/frame-weight-template.hbs | ||
// --output | ||
// pallets/weights/src/weights.rs | ||
|
||
#![cfg_attr(rustfmt, rustfmt_skip)] | ||
#![allow(unused_parens)] | ||
#![allow(unused_imports)] | ||
|
||
use frame_benchmarking::sp_std::marker::PhantomData; | ||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; | ||
|
||
/// Weight functions needed for pallet_weights. | ||
pub trait WeightInfo { | ||
fn duplicate_and_store_benchmark(s: u32, ) -> Weight; | ||
fn store_maybe_hashed_true() -> Weight; | ||
fn store_maybe_hashed_false() -> Weight; | ||
} | ||
|
||
/// Weights for pallet_weights using the Substrate node and recommended hardware. | ||
pub struct SubstrateWeight<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { | ||
// Storage: WeightsModule VecDup (r:0 w:1) | ||
fn duplicate_and_store_benchmark(s: u32, ) -> Weight { | ||
(1_466_000 as Weight) | ||
// Standard Error: 0 | ||
.saturating_add((3_000 as Weight).saturating_mul(s as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) | ||
} | ||
// Storage: WeightsModule Data (r:0 w:1) | ||
fn store_maybe_hashed_true() -> Weight { | ||
(115_844_000 as Weight) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) | ||
} | ||
// Storage: WeightsModule Data (r:0 w:1) | ||
fn store_maybe_hashed_false() -> Weight { | ||
(41_443_000 as Weight) | ||
.saturating_add(T::DbWeight::get().writes(1 as Weight)) | ||
} | ||
} | ||
|
||
// For backwards compatibility and tests | ||
impl WeightInfo for () { | ||
// Storage: WeightsModule VecDup (r:0 w:1) | ||
fn duplicate_and_store_benchmark(s: u32, ) -> Weight { | ||
(1_466_000 as Weight) | ||
// Standard Error: 0 | ||
.saturating_add((3_000 as Weight).saturating_mul(s as Weight)) | ||
.saturating_add(RocksDbWeight::get().writes(1 as Weight)) | ||
} | ||
// Storage: WeightsModule Data (r:0 w:1) | ||
fn store_maybe_hashed_true() -> Weight { | ||
(115_844_000 as Weight) | ||
.saturating_add(RocksDbWeight::get().writes(1 as Weight)) | ||
} | ||
// Storage: WeightsModule Data (r:0 w:1) | ||
fn store_maybe_hashed_false() -> Weight { | ||
(41_443_000 as Weight) | ||
.saturating_add(RocksDbWeight::get().writes(1 as Weight)) | ||
} | ||
} |