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
//! Autogenerated weights for pallet_block_rewards
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION
//! 4.0.0-dev DATE: 2024-03-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH
//! RANGE: `[]` WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN:
//! Some("centrifuge-dev"), DB CACHE: 1024

// Executed Command:
// target/release/centrifuge-chain
// benchmark
// pallet
// --chain=development
// --steps=50
// --repeat=20
// --pallet=pallet-block-rewards
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./scripts/frame-weight-template.hbs
// --output=./pallets/block-rewards/src/weights.rs

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

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

/// Weight functions needed for pallet_block_rewards.
pub trait WeightInfo {
	fn claim_reward() -> Weight;
	fn set_collator_reward_per_session() -> Weight;
	fn set_annual_treasury_inflation_rate() -> Weight;
}

/// Weights for pallet_block_rewards using the Substrate node and recommended
/// hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
	fn claim_reward() -> Weight {
		Weight::from_parts(90_960_000, 0)
			.saturating_add(Weight::from_parts(0, 6196))
			.saturating_add(T::DbWeight::get().reads(5))
			.saturating_add(T::DbWeight::get().writes(3))
	}

	fn set_collator_reward_per_session() -> Weight {
		Weight::from_parts(9_327_000, 0)
			.saturating_add(Weight::from_parts(0, 3582))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}

	fn set_annual_treasury_inflation_rate() -> Weight {
		Weight::from_parts(9_418_000, 0)
			.saturating_add(Weight::from_parts(0, 3582))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
}

// For backwards compatibility and tests
impl WeightInfo for () {
	fn claim_reward() -> Weight {
		Weight::from_parts(90_960_000, 0)
			.saturating_add(Weight::from_parts(0, 6196))
			.saturating_add(RocksDbWeight::get().reads(5))
			.saturating_add(RocksDbWeight::get().writes(3))
	}

	fn set_collator_reward_per_session() -> Weight {
		Weight::from_parts(9_327_000, 0)
			.saturating_add(Weight::from_parts(0, 3582))
			.saturating_add(RocksDbWeight::get().reads(1))
			.saturating_add(RocksDbWeight::get().writes(1))
	}

	fn set_annual_treasury_inflation_rate() -> Weight {
		Weight::from_parts(9_418_000, 0)
			.saturating_add(Weight::from_parts(0, 3582))
			.saturating_add(RocksDbWeight::get().reads(1))
			.saturating_add(RocksDbWeight::get().writes(1))
	}
}