code/pallets/drand/src/weights.rs

weights.rs

84 lines · 3,662 bytes · 89eb75f38fRawGitHub
// Weights for `pallet_drand`.
//
// Stubbed entries were auto-generated by weight-stub.
// Re-generate with real values by running benchmarks:
//   ./scripts/benchmark_all.sh pallet_drand

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
#![allow(dead_code)]

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

/// Weight functions needed for `pallet_drand`.
pub trait WeightInfo {
	fn set_beacon_config() -> Weight;
	fn write_pulse() -> Weight;
	fn set_oldest_stored_round() -> Weight;
}

/// Weights for `pallet_drand` using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
	fn set_beacon_config() -> Weight {
		Weight::from_parts(8_766_000, 0)
			.saturating_add(T::DbWeight::get().writes(2_u64))
	}
	/// Storage: `Drand::BeaconConfig` (r:1 w:0)
	/// Proof: `Drand::BeaconConfig` (`max_values`: Some(1), `max_size`: Some(238), added: 733, mode: `MaxEncodedLen`)
	/// Storage: `Drand::LastStoredRound` (r:1 w:1)
	/// Proof: `Drand::LastStoredRound` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
	/// Storage: `Drand::OldestStoredRound` (r:1 w:1)
	/// Proof: `Drand::OldestStoredRound` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
	/// Storage: `Drand::Pulses` (r:0 w:1)
	/// Proof: `Drand::Pulses` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`)
	/// Storage: `Drand::NextUnsignedAt` (r:0 w:1)
	/// Proof: `Drand::NextUnsignedAt` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
	fn write_pulse() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `238`
		//  Estimated: `1723`
		// Minimum execution time: 5_040_693_000 picoseconds.
		Weight::from_parts(5_051_984_000, 1723)
			.saturating_add(T::DbWeight::get().reads(3_u64))
			.saturating_add(T::DbWeight::get().writes(4_u64))
	}
	fn set_oldest_stored_round() -> Weight {
		Weight::from_parts(5_370_000, 0)
			.saturating_add(T::DbWeight::get().writes(1_u64))
	}
}

// For backwards compatibility and tests.
impl WeightInfo for () {
	fn set_beacon_config() -> Weight {
		Weight::from_parts(8_766_000, 0)
			.saturating_add(RocksDbWeight::get().writes(2_u64))
	}
	/// Storage: `Drand::BeaconConfig` (r:1 w:0)
	/// Proof: `Drand::BeaconConfig` (`max_values`: Some(1), `max_size`: Some(238), added: 733, mode: `MaxEncodedLen`)
	/// Storage: `Drand::LastStoredRound` (r:1 w:1)
	/// Proof: `Drand::LastStoredRound` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
	/// Storage: `Drand::OldestStoredRound` (r:1 w:1)
	/// Proof: `Drand::OldestStoredRound` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`)
	/// Storage: `Drand::Pulses` (r:0 w:1)
	/// Proof: `Drand::Pulses` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`)
	/// Storage: `Drand::NextUnsignedAt` (r:0 w:1)
	/// Proof: `Drand::NextUnsignedAt` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
	fn write_pulse() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `238`
		//  Estimated: `1723`
		// Minimum execution time: 5_040_693_000 picoseconds.
		Weight::from_parts(5_051_984_000, 1723)
			.saturating_add(RocksDbWeight::get().reads(3_u64))
			.saturating_add(RocksDbWeight::get().writes(4_u64))
	}
	fn set_oldest_stored_round() -> Weight {
		Weight::from_parts(5_370_000, 0)
			.saturating_add(RocksDbWeight::get().writes(1_u64))
	}
}