Skip to content
Snippets Groups Projects
template.hbs 686 B
Newer Older
{{header}}

#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(dead_code)]

use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

pub struct ModuleWeights<T>(PhantomData<T>);
impl<T: frame_system::Config> ModuleWeights<T> {
	{{~#each benchmarks as |benchmark|}}
	pub fn {{benchmark.name~}} () -> Weight {
		({{underscore benchmark.base_weight}} as Weight)
			{{~#if (ne benchmark.base_reads "0")}}
			.saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}} as Weight))
			{{~/if}}
			{{~#if (ne benchmark.base_writes "0")}}
			.saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}} as Weight))
			{{~/if}}
	}
	{{~/each}}
}