git.delta.rocks / unique-network / refs/commits / 19dbab98f182

difftreelog

style allow missing docs in weights

Yaroslav Bolyukin2022-07-12parent: #dced9b9.patch.diff
in: master

1 file changed

modified.maintain/frame-weight-template.hbsdiffbeforeafterboth
before · .maintain/frame-weight-template.hbs
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//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}89// Executed Command:10{{#each args as |arg|}}11// {{arg}}12{{/each}}1314#![cfg_attr(rustfmt, rustfmt_skip)]15#![allow(unused_parens)]16#![allow(unused_imports)]17#![allow(clippy::unnecessary_cast)]1819use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};20use sp_std::marker::PhantomData;2122/// Weight functions needed for {{pallet}}.23pub trait WeightInfo {24	{{#each benchmarks as |benchmark|}}25	fn {{benchmark.name~}}26	(27		{{~#each benchmark.components as |c| ~}}28		{{c.name}}: u32, {{/each~}}29	) -> Weight;30	{{/each}}31}3233/// Weights for {{pallet}} using the Substrate node and recommended hardware.34pub struct SubstrateWeight<T>(PhantomData<T>);35{{#if (eq pallet "frame_system")}}36impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {37{{else}}38impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {39{{/if}}40	{{#each benchmarks as |benchmark|}}41	{{#each benchmark.comments as |comment|}}42	// {{comment}}43	{{/each}}44	fn {{benchmark.name~}}45	(46		{{~#each benchmark.components as |c| ~}}47		{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}48	) -> Weight {49		({{underscore benchmark.base_weight}} as Weight)50			{{#each benchmark.component_weight as |cw|}}51			// Standard Error: {{underscore cw.error}}52			.saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))53			{{/each}}54			{{#if (ne benchmark.base_reads "0")}}55			.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight))56			{{/if}}57			{{#each benchmark.component_reads as |cr|}}58			.saturating_add(T::DbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight)))59			{{/each}}60			{{#if (ne benchmark.base_writes "0")}}61			.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight))62			{{/if}}63			{{#each benchmark.component_writes as |cw|}}64			.saturating_add(T::DbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)))65			{{/each}}66	}67	{{/each}}68}6970// For backwards compatibility and tests71impl WeightInfo for () {72	{{#each benchmarks as |benchmark|}}73	{{#each benchmark.comments as |comment|}}74	// {{comment}}75	{{/each}}76	fn {{benchmark.name~}}77	(78		{{~#each benchmark.components as |c| ~}}79		{{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}}80	) -> Weight {81		({{underscore benchmark.base_weight}} as Weight)82			{{#each benchmark.component_weight as |cw|}}83			// Standard Error: {{underscore cw.error}}84			.saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))85			{{/each}}86			{{#if (ne benchmark.base_reads "0")}}87			.saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}} as Weight))88			{{/if}}89			{{#each benchmark.component_reads as |cr|}}90			.saturating_add(RocksDbWeight::get().reads(({{cr.slope}} as Weight).saturating_mul({{cr.name}} as Weight)))91			{{/each}}92			{{#if (ne benchmark.base_writes "0")}}93			.saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}} as Weight))94			{{/if}}95			{{#each benchmark.component_writes as |cw|}}96			.saturating_add(RocksDbWeight::get().writes(({{cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight)))97			{{/each}}98	}99	{{/each}}100}