// Copyright 2022-2024 Forecasting Technologies LTD.
// Copyright 2021-2022 Zeitgeist PM LLC.
//
// This file is part of Zeitgeist.
//
// Zeitgeist is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at
// your option) any later version.
//
// Zeitgeist is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Zeitgeist. If not, see <https://www.gnu.org/licenses/>.

//! Autogenerated weights for zrml_neo_swaps
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: `2024-08-28`, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `zeitgeist-benchmark`, CPU: `AMD EPYC 7601 32-Core Processor`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024`

// Executed Command:
// ./target/production/zeitgeist
// benchmark
// pallet
// --chain=dev
// --steps=50
// --repeat=20
// --pallet=zrml_neo_swaps
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./misc/weight_template.hbs
// --header=./HEADER_GPL3
// --output=./zrml/neo-swaps/src/weights.rs

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

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

///  Trait containing the required functions for weight retrival within
/// zrml_neo_swaps (automatically generated)
pub trait WeightInfoZeitgeist {
    fn buy(n: u32) -> Weight;
    fn sell(n: u32) -> Weight;
    fn join_in_place(n: u32) -> Weight;
    fn join_reassigned(n: u32) -> Weight;
    fn join_leaf(n: u32) -> Weight;
    fn exit(n: u32) -> Weight;
    fn withdraw_fees() -> Weight;
    fn deploy_pool(n: u32) -> Weight;
}

/// Weight functions for zrml_neo_swaps (automatically generated)
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfoZeitgeist for WeightInfo<T> {
    /// Storage: `MarketCommons::Markets` (r:1 w:0)
    /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`)
    /// Storage: `NeoSwaps::Pools` (r:1 w:1)
    /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`)
    /// Storage: `System::Account` (r:3 w:3)
    /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:129 w:129)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::TotalIssuance` (r:128 w:128)
    /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`)
    /// The range of component `n` is `[2, 128]`.
    fn buy(n: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `1283 + n * (163 ±0)`
        //  Estimated: `148211 + n * (2598 ±0)`
        // Minimum execution time: 367_628 nanoseconds.
        Weight::from_parts(352_364_640, 148211)
            // Standard Error: 44_817
            .saturating_add(Weight::from_parts(16_342_365, 0).saturating_mul(n.into()))
            .saturating_add(T::DbWeight::get().reads(6))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
            .saturating_add(T::DbWeight::get().writes(5))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into())))
            .saturating_add(Weight::from_parts(0, 2598).saturating_mul(n.into()))
    }
    /// Storage: `MarketCommons::Markets` (r:1 w:0)
    /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`)
    /// Storage: `NeoSwaps::Pools` (r:1 w:1)
    /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:129 w:129)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// Storage: `System::Account` (r:3 w:3)
    /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::TotalIssuance` (r:128 w:128)
    /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`)
    /// The range of component `n` is `[2, 128]`.
    fn sell(n: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `1414 + n * (163 ±0)`
        //  Estimated: `148211 + n * (2598 ±0)`
        // Minimum execution time: 290_977 nanoseconds.
        Weight::from_parts(251_827_451, 148211)
            // Standard Error: 26_730
            .saturating_add(Weight::from_parts(23_379_744, 0).saturating_mul(n.into()))
            .saturating_add(T::DbWeight::get().reads(6))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
            .saturating_add(T::DbWeight::get().writes(5))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into())))
            .saturating_add(Weight::from_parts(0, 2598).saturating_mul(n.into()))
    }
    /// Storage: `MarketCommons::Markets` (r:1 w:0)
    /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`)
    /// Storage: `NeoSwaps::Pools` (r:1 w:1)
    /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:256 w:256)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// Storage: `System::Account` (r:1 w:0)
    /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`)
    /// The range of component `n` is `[2, 128]`.
    fn join_in_place(n: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `139311 + n * (197 ±0)`
        //  Estimated: `148211 + n * (5196 ±0)`
        // Minimum execution time: 280_475 nanoseconds.
        Weight::from_parts(216_619_883, 148211)
            // Standard Error: 169_197
            .saturating_add(Weight::from_parts(30_980_963, 0).saturating_mul(n.into()))
            .saturating_add(T::DbWeight::get().reads(3))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
            .saturating_add(T::DbWeight::get().writes(1))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into())))
            .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into()))
    }
    /// Storage: `MarketCommons::Markets` (r:1 w:0)
    /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`)
    /// Storage: `NeoSwaps::Pools` (r:1 w:1)
    /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:256 w:256)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// Storage: `System::Account` (r:1 w:0)
    /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`)
    /// The range of component `n` is `[2, 128]`.
    fn join_reassigned(n: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `139107 + n * (197 ±0)`
        //  Estimated: `148211 + n * (5196 ±0)`
        // Minimum execution time: 306_517 nanoseconds.
        Weight::from_parts(192_506_242, 148211)
            // Standard Error: 186_645
            .saturating_add(Weight::from_parts(32_347_165, 0).saturating_mul(n.into()))
            .saturating_add(T::DbWeight::get().reads(3))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
            .saturating_add(T::DbWeight::get().writes(1))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into())))
            .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into()))
    }
    /// Storage: `MarketCommons::Markets` (r:1 w:0)
    /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`)
    /// Storage: `NeoSwaps::Pools` (r:1 w:1)
    /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:256 w:256)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// Storage: `System::Account` (r:1 w:0)
    /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`)
    /// The range of component `n` is `[2, 128]`.
    fn join_leaf(n: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `138611 + n * (197 ±0)`
        //  Estimated: `148211 + n * (5196 ±0)`
        // Minimum execution time: 333_727 nanoseconds.
        Weight::from_parts(276_851_445, 148211)
            // Standard Error: 174_609
            .saturating_add(Weight::from_parts(31_456_446, 0).saturating_mul(n.into()))
            .saturating_add(T::DbWeight::get().reads(3))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
            .saturating_add(T::DbWeight::get().writes(1))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into())))
            .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into()))
    }
    /// Storage: `MarketCommons::Markets` (r:1 w:0)
    /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`)
    /// Storage: `NeoSwaps::Pools` (r:1 w:1)
    /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:256 w:256)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// Storage: `System::Account` (r:1 w:0)
    /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`)
    /// The range of component `n` is `[2, 128]`.
    fn exit(n: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `139208 + n * (197 ±0)`
        //  Estimated: `148211 + n * (5196 ±0)`
        // Minimum execution time: 325_537 nanoseconds.
        Weight::from_parts(344_456_185, 148211)
            // Standard Error: 201_865
            .saturating_add(Weight::from_parts(30_432_204, 0).saturating_mul(n.into()))
            .saturating_add(T::DbWeight::get().reads(3))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
            .saturating_add(T::DbWeight::get().writes(1))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into())))
            .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into()))
    }
    /// Storage: `NeoSwaps::Pools` (r:1 w:1)
    /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`)
    /// Storage: `System::Account` (r:2 w:2)
    /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`)
    fn withdraw_fees() -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `137756`
        //  Estimated: `148211`
        // Minimum execution time: 310_396 nanoseconds.
        Weight::from_parts(328_797_000, 148211)
            .saturating_add(T::DbWeight::get().reads(3))
            .saturating_add(T::DbWeight::get().writes(3))
    }
    /// Storage: `MarketCommons::Markets` (r:1 w:0)
    /// Proof: `MarketCommons::Markets` (`max_values`: None, `max_size`: Some(694), added: 3169, mode: `MaxEncodedLen`)
    /// Storage: `NeoSwaps::Pools` (r:1 w:1)
    /// Proof: `NeoSwaps::Pools` (`max_values`: None, `max_size`: Some(144746), added: 147221, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:256 w:256)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// Storage: `System::Account` (r:1 w:1)
    /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`)
    /// The range of component `n` is `[2, 128]`.
    fn deploy_pool(n: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `611 + n * (81 ±0)`
        //  Estimated: `148211 + n * (5196 ±0)`
        // Minimum execution time: 161_493 nanoseconds.
        Weight::from_parts(109_983_447, 148211)
            // Standard Error: 44_260
            .saturating_add(Weight::from_parts(34_197_887, 0).saturating_mul(n.into()))
            .saturating_add(T::DbWeight::get().reads(3))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(n.into())))
            .saturating_add(T::DbWeight::get().writes(2))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(n.into())))
            .saturating_add(Weight::from_parts(0, 5196).saturating_mul(n.into()))
    }
}
