git.delta.rocks / unique-network / refs/commits / 2e72efeb8353

difftreelog

source

.maintain/external-weight-template.hbs3.1 KiBsourcehistory
1// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs23//! Autogenerated weights for {{pallet}}4//!5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}6//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`7//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}`8//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}910// Executed Command:11{{#each args as |arg|}}12// {{arg}}13{{/each}}1415#![cfg_attr(rustfmt, rustfmt_skip)]16#![allow(unused_parens)]17#![allow(unused_imports)]18#![allow(missing_docs)]19#![allow(clippy::unnecessary_cast)]2021use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};22use sp_std::marker::PhantomData;2324/// Weights for {{pallet}} using the Substrate node and recommended hardware.25pub struct SubstrateWeight<T>(PhantomData<T>);26{{#if (eq pallet "frame_system")}}27impl<T: crate::Config> {{pallet}}::WeightInfo for SubstrateWeight<T> {28{{else}}29impl<T: frame_system::Config> {{pallet}}::WeightInfo for SubstrateWeight<T> {30{{/if}}31	{{#each benchmarks as |benchmark|}}32	{{#each benchmark.comments as |comment|}}33	/// {{comment}}34	{{/each}}35	{{#each benchmark.component_ranges as |range|}}36	/// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`.37	{{/each}}38	fn {{benchmark.name~}}39	(40		{{~#each benchmark.components as |c| ~}}41		{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}42	) -> Weight {43		// Proof Size summary in bytes:44		//  Measured:  `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`45		//  Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}`46		// Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds.47		Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}})48			{{#each benchmark.component_weight as |cw|}}49			// Standard Error: {{underscore cw.error}}50			.saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into()))51			{{/each}}52			{{#if (ne benchmark.base_reads "0")}}53			.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64))54			{{/if}}55			{{#each benchmark.component_reads as |cr|}}56			.saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into())))57			{{/each}}58			{{#if (ne benchmark.base_writes "0")}}59			.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64))60			{{/if}}61			{{#each benchmark.component_writes as |cw|}}62			.saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into())))63			{{/each}}64			{{#each benchmark.component_calculated_proof_size as |cp|}}65			.saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into()))66			{{/each}}67	}68	{{/each}}69}70