1
// This file is part of Substrate.
2

            
3
// Copyright (C) Parity Technologies (UK) Ltd.
4
// SPDX-License-Identifier: Apache-2.0
5

            
6
// Licensed under the Apache License, Version 2.0 (the "License");
7
// you may not use this file except in compliance with the License.
8
// You may obtain a copy of the License at
9
//
10
// 	http://www.apache.org/licenses/LICENSE-2.0
11
//
12
// Unless required by applicable law or agreed to in writing, software
13
// distributed under the License is distributed on an "AS IS" BASIS,
14
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
// See the License for the specific language governing permissions and
16
// limitations under the License.
17

            
18
//! Autogenerated weights for `pallet_timestamp`
19
//!
20
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
21
//! DATE: 2024-04-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
22
//! WORST CASE MAP SIZE: `1000000`
23
//! HOSTNAME: `runner-anb7yjbi-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
24
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`
25

            
26
// Executed Command:
27
// ./target/production/substrate-node
28
// benchmark
29
// pallet
30
// --chain=dev
31
// --steps=50
32
// --repeat=20
33
// --pallet=pallet_timestamp
34
// --no-storage-info
35
// --no-median-slopes
36
// --no-min-squares
37
// --extrinsic=*
38
// --wasm-execution=compiled
39
// --heap-pages=4096
40
// --output=./substrate/frame/timestamp/src/weights.rs
41
// --header=./substrate/HEADER-APACHE2
42
// --template=./substrate/.maintain/frame-weight-template.hbs
43

            
44
#![cfg_attr(rustfmt, rustfmt_skip)]
45
#![allow(unused_parens)]
46
#![allow(unused_imports)]
47
#![allow(missing_docs)]
48

            
49
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
50
use core::marker::PhantomData;
51

            
52
/// Weight functions needed for `pallet_timestamp`.
53
pub trait WeightInfo {
54
	fn set() -> Weight;
55
	fn on_finalize() -> Weight;
56
}
57

            
58
/// Weights for `pallet_timestamp` using the Substrate node and recommended hardware.
59
pub struct SubstrateWeight<T>(PhantomData<T>);
60
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
61
	/// Storage: `Timestamp::Now` (r:1 w:1)
62
	/// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
63
	/// Storage: `Babe::CurrentSlot` (r:1 w:0)
64
	/// Proof: `Babe::CurrentSlot` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
65
	fn set() -> Weight {
66
		// Proof Size summary in bytes:
67
		//  Measured:  `345`
68
		//  Estimated: `1493`
69
		// Minimum execution time: 8_356_000 picoseconds.
70
		Weight::from_parts(8_684_000, 1493)
71
			.saturating_add(T::DbWeight::get().reads(2_u64))
72
			.saturating_add(T::DbWeight::get().writes(1_u64))
73
	}
74
	fn on_finalize() -> Weight {
75
		// Proof Size summary in bytes:
76
		//  Measured:  `194`
77
		//  Estimated: `0`
78
		// Minimum execution time: 3_886_000 picoseconds.
79
		Weight::from_parts(4_118_000, 0)
80
	}
81
}
82

            
83
// For backwards compatibility and tests.
84
impl WeightInfo for () {
85
	/// Storage: `Timestamp::Now` (r:1 w:1)
86
	/// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
87
	/// Storage: `Babe::CurrentSlot` (r:1 w:0)
88
	/// Proof: `Babe::CurrentSlot` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
89
	fn set() -> Weight {
90
		// Proof Size summary in bytes:
91
		//  Measured:  `345`
92
		//  Estimated: `1493`
93
		// Minimum execution time: 8_356_000 picoseconds.
94
		Weight::from_parts(8_684_000, 1493)
95
			.saturating_add(RocksDbWeight::get().reads(2_u64))
96
			.saturating_add(RocksDbWeight::get().writes(1_u64))
97
	}
98
	fn on_finalize() -> Weight {
99
		// Proof Size summary in bytes:
100
		//  Measured:  `194`
101
		//  Estimated: `0`
102
		// Minimum execution time: 3_886_000 picoseconds.
103
		Weight::from_parts(4_118_000, 0)
104
	}
105
}