referrerpolicy=no-referrer-when-downgrade

pallet_mmr/
default_weights.rs

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//! Default weights for the MMR Pallet
19//! This file was not auto-generated.
20
21use frame::{deps::frame_support::weights::constants::*, weights_prelude::*};
22
23impl crate::WeightInfo for () {
24	fn on_initialize(peaks: u32) -> Weight {
25		let peaks = u64::from(peaks);
26		// Reading the parent hash.
27		let leaf_weight = RocksDbWeight::get().reads(1);
28		// Blake2 hash cost.
29		let hash_weight = Weight::from_parts(2u64 * WEIGHT_REF_TIME_PER_NANOS, 0);
30		// No-op hook.
31		let hook_weight = Weight::zero();
32
33		leaf_weight
34			.saturating_add(hash_weight)
35			.saturating_add(hook_weight)
36			.saturating_add(RocksDbWeight::get().reads_writes(2 + peaks, 2 + peaks))
37	}
38}