// 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_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_swaps
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./misc/weight_template.hbs
// --header=./HEADER_GPL3
// --output=./zrml/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_swaps (automatically generated)
pub trait WeightInfoZeitgeist {
    fn pool_exit(a: u32) -> Weight;
    fn pool_exit_with_exact_asset_amount() -> Weight;
    fn pool_exit_with_exact_pool_amount() -> Weight;
    fn pool_join(a: u32) -> Weight;
    fn pool_join_with_exact_asset_amount() -> Weight;
    fn pool_join_with_exact_pool_amount() -> Weight;
    fn swap_exact_amount_in() -> Weight;
    fn swap_exact_amount_out() -> Weight;
    fn open_pool(a: u32) -> Weight;
    fn close_pool(a: u32) -> Weight;
    fn destroy_pool(a: u32) -> Weight;
}

/// Weight functions for zrml_swaps (automatically generated)
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfoZeitgeist for WeightInfo<T> {
    /// Storage: `Swaps::Pools` (r:1 w:0)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::TotalIssuance` (r:1 w:1)
    /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:131 w:131)
    /// 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 `a` is `[2, 65]`.
    fn pool_exit(a: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `753 + a * (144 ±0)`
        //  Estimated: `7044 + a * (5196 ±0)`
        // Minimum execution time: 115_682 nanoseconds.
        Weight::from_parts(57_135_146, 7044)
            // Standard Error: 45_413
            .saturating_add(Weight::from_parts(32_382_863, 0).saturating_mul(a.into()))
            .saturating_add(T::DbWeight::get().reads(4))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into())))
            .saturating_add(T::DbWeight::get().writes(2))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into())))
            .saturating_add(Weight::from_parts(0, 5196).saturating_mul(a.into()))
    }
    /// Storage: `Swaps::Pools` (r:1 w:0)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:3 w:3)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::TotalIssuance` (r:1 w:1)
    /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`)
    /// Storage: `System::Account` (r:1 w:0)
    /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(132), added: 2607, mode: `MaxEncodedLen`)
    fn pool_exit_with_exact_asset_amount() -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `5419`
        //  Estimated: `8784`
        // Minimum execution time: 99_472 nanoseconds.
        Weight::from_parts(101_822_000, 8784)
            .saturating_add(T::DbWeight::get().reads(6))
            .saturating_add(T::DbWeight::get().writes(4))
    }
    /// Storage: `Swaps::Pools` (r:1 w:0)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::TotalIssuance` (r:1 w:1)
    /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:3 w:3)
    /// 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`)
    fn pool_exit_with_exact_pool_amount() -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `5419`
        //  Estimated: `8784`
        // Minimum execution time: 100_372 nanoseconds.
        Weight::from_parts(104_022_000, 8784)
            .saturating_add(T::DbWeight::get().reads(6))
            .saturating_add(T::DbWeight::get().writes(4))
    }
    /// Storage: `Swaps::Pools` (r:1 w:0)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::TotalIssuance` (r:1 w:1)
    /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:131 w:131)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// The range of component `a` is `[2, 65]`.
    fn pool_join(a: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `662 + a * (225 ±0)`
        //  Estimated: `7044 + a * (5196 ±0)`
        // Minimum execution time: 90_542 nanoseconds.
        Weight::from_parts(45_195_977, 7044)
            // Standard Error: 36_535
            .saturating_add(Weight::from_parts(24_227_254, 0).saturating_mul(a.into()))
            .saturating_add(T::DbWeight::get().reads(3))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into())))
            .saturating_add(T::DbWeight::get().writes(2))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into())))
            .saturating_add(Weight::from_parts(0, 5196).saturating_mul(a.into()))
    }
    /// Storage: `Swaps::Pools` (r:1 w:0)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::TotalIssuance` (r:1 w:1)
    /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:3 w:3)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    fn pool_join_with_exact_asset_amount() -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `6101`
        //  Estimated: `8784`
        // Minimum execution time: 88_641 nanoseconds.
        Weight::from_parts(96_472_000, 8784)
            .saturating_add(T::DbWeight::get().reads(5))
            .saturating_add(T::DbWeight::get().writes(4))
    }
    /// Storage: `Swaps::Pools` (r:1 w:0)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::TotalIssuance` (r:1 w:1)
    /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:3 w:3)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    fn pool_join_with_exact_pool_amount() -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `6101`
        //  Estimated: `8784`
        // Minimum execution time: 84_563 nanoseconds.
        Weight::from_parts(86_641_000, 8784)
            .saturating_add(T::DbWeight::get().reads(5))
            .saturating_add(T::DbWeight::get().writes(4))
    }
    /// Storage: `Swaps::Pools` (r:1 w:0)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:4 w:4)
    /// 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`)
    fn swap_exact_amount_in() -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `4984`
        //  Estimated: `11382`
        // Minimum execution time: 140_663 nanoseconds.
        Weight::from_parts(144_523_000, 11382)
            .saturating_add(T::DbWeight::get().reads(6))
            .saturating_add(T::DbWeight::get().writes(4))
    }
    /// Storage: `Swaps::Pools` (r:1 w:0)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:4 w:4)
    /// 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`)
    fn swap_exact_amount_out() -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `4984`
        //  Estimated: `11382`
        // Minimum execution time: 139_963 nanoseconds.
        Weight::from_parts(144_974_000, 11382)
            .saturating_add(T::DbWeight::get().reads(6))
            .saturating_add(T::DbWeight::get().writes(4))
    }
    /// Storage: `Swaps::Pools` (r:1 w:1)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// The range of component `a` is `[2, 65]`.
    fn open_pool(a: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `136 + a * (54 ±0)`
        //  Estimated: `7044`
        // Minimum execution time: 14_660 nanoseconds.
        Weight::from_parts(16_289_076, 7044)
            // Standard Error: 2_416
            .saturating_add(Weight::from_parts(266_489, 0).saturating_mul(a.into()))
            .saturating_add(T::DbWeight::get().reads(1))
            .saturating_add(T::DbWeight::get().writes(1))
    }
    /// Storage: `Swaps::Pools` (r:1 w:1)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// The range of component `a` is `[2, 65]`.
    fn close_pool(a: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `136 + a * (54 ±0)`
        //  Estimated: `7044`
        // Minimum execution time: 12_770 nanoseconds.
        Weight::from_parts(14_172_854, 7044)
            // Standard Error: 1_581
            .saturating_add(Weight::from_parts(167_226, 0).saturating_mul(a.into()))
            .saturating_add(T::DbWeight::get().reads(1))
            .saturating_add(T::DbWeight::get().writes(1))
    }
    /// Storage: `Swaps::Pools` (r:1 w:1)
    /// Proof: `Swaps::Pools` (`max_values`: None, `max_size`: Some(3579), added: 6054, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::Accounts` (r:65 w:65)
    /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(123), added: 2598, mode: `MaxEncodedLen`)
    /// Storage: `Tokens::TotalIssuance` (r:65 w:65)
    /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(43), added: 2518, 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 `a` is `[2, 65]`.
    fn destroy_pool(a: u32) -> Weight {
        // Proof Size summary in bytes:
        //  Measured:  `505 + a * (182 ±0)`
        //  Estimated: `7044 + a * (2598 ±0)`
        // Minimum execution time: 68_381 nanoseconds.
        Weight::from_parts(22_885_205, 7044)
            // Standard Error: 34_196
            .saturating_add(Weight::from_parts(21_629_035, 0).saturating_mul(a.into()))
            .saturating_add(T::DbWeight::get().reads(2))
            .saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(a.into())))
            .saturating_add(T::DbWeight::get().writes(2))
            .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into())))
            .saturating_add(Weight::from_parts(0, 2598).saturating_mul(a.into()))
    }
}
