1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//! Autogenerated weights for pallet_merkle
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-02-17, STEPS: [20, ], REPEAT: 5, LOW RANGE: [], HIGH RANGE: []
//! EXECUTION: None, WASM-EXECUTION: Interpreted, CHAIN: Some("dev"), DB CACHE:
//! 128

// Executed Command:
// ./target/release/node-template
// benchmark
// --chain
// dev
// --pallet
// pallet_merkle
// --extrinsic
// *
// --steps
// 20
// --repeat
// 5
// --output
// ./pallets/merkle/src/

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

use crate::Config;
use frame_support::{
	traits::Get,
	weights::{constants::RocksDbWeight, Weight},
};
use sp_std::marker::PhantomData;

/// Weight functions needed for pallet_merkle.
pub trait WeightInfo {
	fn create_group(n: u32) -> Weight;
	fn set_manager_required() -> Weight;
	fn set_manager() -> Weight;
	fn set_stopped() -> Weight;
	fn add_members(n: u32) -> Weight;
	fn verify_path(n: u32) -> Weight;
	fn on_finalize() -> Weight;
}

/// Weight functions for pallet_merkle.
pub struct Weights<T>(PhantomData<T>);
impl<T: frame_system::Config + Config> WeightInfo for Weights<T> {
	fn create_group(d: u32) -> Weight {
		(8_356_000 as Weight)
			// Standard Error: 4_000
			.saturating_add((151_000 as Weight).saturating_mul(d as Weight))
			.saturating_add(T::DbWeight::get().reads(1 as Weight))
			.saturating_add(T::DbWeight::get().writes(3 as Weight))
	}

	fn set_manager_required() -> Weight {
		(7_000_000 as Weight)
			.saturating_add(T::DbWeight::get().reads(1 as Weight))
			.saturating_add(T::DbWeight::get().writes(1 as Weight))
	}

	fn set_manager() -> Weight {
		(8_000_000 as Weight)
			.saturating_add(T::DbWeight::get().reads(1 as Weight))
			.saturating_add(T::DbWeight::get().writes(1 as Weight))
	}

	fn set_stopped() -> Weight {
		(8_000_000 as Weight)
			.saturating_add(T::DbWeight::get().reads(1 as Weight))
			.saturating_add(T::DbWeight::get().writes(1 as Weight))
	}

	fn add_members(n: u32) -> Weight {
		(384_629_956_000 as Weight)
			// Standard Error: 141_117_000
			.saturating_add((20_135_984_000 as Weight).saturating_mul(n as Weight))
			.saturating_add(T::DbWeight::get().reads(3 as Weight))
			.saturating_add(T::DbWeight::get().writes(2 as Weight))
	}

	fn verify_path(d: u32) -> Weight {
		(383_420_867_000 as Weight)
			// Standard Error: 173_974_000
			.saturating_add((814_291_000 as Weight).saturating_mul(d as Weight))
			.saturating_add(T::DbWeight::get().reads(1 as Weight))
	}

	fn on_finalize() -> Weight {
		(14_000_000 as Weight)
			.saturating_add(T::DbWeight::get().reads(2 as Weight))
			.saturating_add(T::DbWeight::get().writes(1 as Weight))
	}
}