// This file is part of Substrate.

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

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

//! Autogenerated weights for pallet_preimage
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2024-08-21, STEPS: `100`, REPEAT: 5, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 512
//! HOSTNAME: `ubuntu-8gb-nbg1-1-bench2`, CPU: `AMD EPYC-Milan Processor`

// Executed Command:
// ./polymesh
// benchmark
// pallet
// -s
// 100
// -r
// 5
// -p=*
// -e=*
// --heap-pages
// 4096
// --db-cache
// 512
// --execution
// wasm
// --wasm-execution
// compiled
// --output
// ./Polymesh/pallets/weights/src/
// --template
// ./Polymesh/.maintain/frame-weight-template.hbs

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

use polymesh_runtime_common::{RocksDbWeight as DbWeight, Weight};

/// Weights for pallet_preimage using the Substrate node and recommended hardware.
pub struct SubstrateWeight;
impl pallet_preimage::WeightInfo for SubstrateWeight {
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    // Storage: Preimage PreimageFor (r:0 w:1)
    // Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen)
    /// The range of component `s` is `[0, 4194304]`.
    fn note_preimage(s: u32) -> Weight {
        // Minimum execution time: 29_735 nanoseconds.
        Weight::from_ref_time(20_723_157)
            // Standard Error: 1
            .saturating_add(Weight::from_ref_time(1_355).saturating_mul(s.into()))
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(2))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    // Storage: Preimage PreimageFor (r:0 w:1)
    // Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen)
    /// The range of component `s` is `[0, 4194304]`.
    fn note_requested_preimage(s: u32) -> Weight {
        // Minimum execution time: 19_170 nanoseconds.
        Weight::from_ref_time(19_320_000)
            // Standard Error: 8
            .saturating_add(Weight::from_ref_time(1_376).saturating_mul(s.into()))
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(2))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    // Storage: Preimage PreimageFor (r:0 w:1)
    // Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen)
    /// The range of component `s` is `[0, 4194304]`.
    fn note_no_deposit_preimage(s: u32) -> Weight {
        // Minimum execution time: 18_178 nanoseconds.
        Weight::from_ref_time(3_604_168)
            // Standard Error: 2
            .saturating_add(Weight::from_ref_time(1_360).saturating_mul(s.into()))
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(2))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    // Storage: Preimage PreimageFor (r:0 w:1)
    // Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen)
    fn unnote_preimage() -> Weight {
        // Minimum execution time: 46_740 nanoseconds.
        Weight::from_ref_time(48_914_000)
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(2))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    // Storage: Preimage PreimageFor (r:0 w:1)
    // Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen)
    fn unnote_no_deposit_preimage() -> Weight {
        // Minimum execution time: 33_991 nanoseconds.
        Weight::from_ref_time(35_443_000)
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(2))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    fn request_preimage() -> Weight {
        // Minimum execution time: 31_629 nanoseconds.
        Weight::from_ref_time(33_100_000)
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(1))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    fn request_no_deposit_preimage() -> Weight {
        // Minimum execution time: 16_575 nanoseconds.
        Weight::from_ref_time(18_157_000)
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(1))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    fn request_unnoted_preimage() -> Weight {
        // Minimum execution time: 20_550 nanoseconds.
        Weight::from_ref_time(24_016_000)
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(1))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    fn request_requested_preimage() -> Weight {
        // Minimum execution time: 11_498 nanoseconds.
        Weight::from_ref_time(12_098_000)
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(1))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    // Storage: Preimage PreimageFor (r:0 w:1)
    // Proof: Preimage PreimageFor (max_values: None, max_size: Some(4194344), added: 4196819, mode: MaxEncodedLen)
    fn unrequest_preimage() -> Weight {
        // Minimum execution time: 27_622 nanoseconds.
        Weight::from_ref_time(32_909_000)
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(2))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    fn unrequest_unnoted_preimage() -> Weight {
        // Minimum execution time: 10_937 nanoseconds.
        Weight::from_ref_time(11_607_000)
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(1))
    }
    // Storage: Preimage StatusFor (r:1 w:1)
    // Proof: Preimage StatusFor (max_values: None, max_size: Some(91), added: 2566, mode: MaxEncodedLen)
    fn unrequest_multi_referenced_preimage() -> Weight {
        // Minimum execution time: 10_467 nanoseconds.
        Weight::from_ref_time(11_287_000)
            .saturating_add(DbWeight::get().reads(1))
            .saturating_add(DbWeight::get().writes(1))
    }
}
