// Copyright 2023 Watr Foundation
// This file is part of Watr.

// Watr 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.

// Watr 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 Watr.  If not, see <http://www.gnu.org/licenses/>.

//! Autogenerated weights for `pallet_did`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2023-08-09, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `david-tmp-bench`, CPU: `Intel(R) Xeon(R) CPU @ 2.80GHz`
//! EXECUTION: ``, WASM-EXECUTION: `Compiled`, CHAIN: `Some("devnet-dev")`, DB CACHE: 1024

// Executed Command:
// target/release/watr-node
// benchmark
// pallet
// --chain=devnet-dev
// --wasm-execution=compiled
// --pallet=pallet_did
// --extrinsic=*
// --steps=50
// --repeat=20
// --json
// --header=./file_header.txt
// --output=./runtime/devnet/src/weights/pallet_did.rs

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

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

/// Weight functions for `pallet_did`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_did::WeightInfo for WeightInfo<T> {
	/// Storage: `DID::Did` (r:1 w:1)
	/// Proof: `DID::Did` (`max_values`: None, `max_size`: Some(442), added: 2917, mode: `MaxEncodedLen`)
	/// Storage: `DID::Issuers` (r:1 w:0)
	/// Proof: `DID::Issuers` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
	/// Storage: `DID::Services` (r:10 w:10)
	/// Proof: `DID::Services` (`max_values`: None, `max_size`: Some(155), added: 2630, mode: `MaxEncodedLen`)
	/// The range of component `m` is `[0, 10]`.
	fn create_did(m: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `42`
		//  Estimated: `3907 + m * (2630 ±0)`
		// Minimum execution time: 47_565_000 picoseconds.
		Weight::from_parts(50_806_200, 0)
			.saturating_add(Weight::from_parts(0, 3907))
			// Standard Error: 18_083
			.saturating_add(Weight::from_parts(6_325_673, 0).saturating_mul(m.into()))
			.saturating_add(T::DbWeight::get().reads(2))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
			.saturating_add(T::DbWeight::get().writes(1))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(m.into())))
			.saturating_add(Weight::from_parts(0, 2630).saturating_mul(m.into()))
	}
	/// Storage: `DID::Did` (r:1 w:1)
	/// Proof: `DID::Did` (`max_values`: None, `max_size`: Some(442), added: 2917, mode: `MaxEncodedLen`)
	fn update_did() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `193`
		//  Estimated: `3907`
		// Minimum execution time: 25_162_000 picoseconds.
		Weight::from_parts(25_892_000, 0)
			.saturating_add(Weight::from_parts(0, 3907))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	/// Storage: `DID::Did` (r:1 w:1)
	/// Proof: `DID::Did` (`max_values`: None, `max_size`: Some(442), added: 2917, mode: `MaxEncodedLen`)
	/// Storage: `DID::Services` (r:10 w:10)
	/// Proof: `DID::Services` (`max_values`: None, `max_size`: Some(155), added: 2630, mode: `MaxEncodedLen`)
	/// Storage: `DID::Issuers` (r:1 w:0)
	/// Proof: `DID::Issuers` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
	/// The range of component `m` is `[0, 10]`.
	fn remove_did(m: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `210 + m * (97 ±0)`
		//  Estimated: `3907 + m * (2630 ±0)`
		// Minimum execution time: 47_405_000 picoseconds.
		Weight::from_parts(48_479_953, 0)
			.saturating_add(Weight::from_parts(0, 3907))
			// Standard Error: 20_097
			.saturating_add(Weight::from_parts(6_475_267, 0).saturating_mul(m.into()))
			.saturating_add(T::DbWeight::get().reads(2))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
			.saturating_add(T::DbWeight::get().writes(1))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(m.into())))
			.saturating_add(Weight::from_parts(0, 2630).saturating_mul(m.into()))
	}
	/// Storage: `DID::Did` (r:1 w:1)
	/// Proof: `DID::Did` (`max_values`: None, `max_size`: Some(442), added: 2917, mode: `MaxEncodedLen`)
	/// Storage: `DID::Services` (r:10 w:10)
	/// Proof: `DID::Services` (`max_values`: None, `max_size`: Some(155), added: 2630, mode: `MaxEncodedLen`)
	/// The range of component `m` is `[0, 10]`.
	fn add_did_services(m: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `193`
		//  Estimated: `3907 + m * (2630 ±0)`
		// Minimum execution time: 24_099_000 picoseconds.
		Weight::from_parts(26_761_720, 0)
			.saturating_add(Weight::from_parts(0, 3907))
			// Standard Error: 13_308
			.saturating_add(Weight::from_parts(6_338_936, 0).saturating_mul(m.into()))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
			.saturating_add(T::DbWeight::get().writes(1))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(m.into())))
			.saturating_add(Weight::from_parts(0, 2630).saturating_mul(m.into()))
	}
	/// Storage: `DID::Did` (r:1 w:1)
	/// Proof: `DID::Did` (`max_values`: None, `max_size`: Some(442), added: 2917, mode: `MaxEncodedLen`)
	/// Storage: `DID::Services` (r:10 w:10)
	/// Proof: `DID::Services` (`max_values`: None, `max_size`: Some(155), added: 2630, mode: `MaxEncodedLen`)
	/// The range of component `m` is `[0, 10]`.
	fn remove_did_services(m: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `210 + m * (97 ±0)`
		//  Estimated: `3907 + m * (2630 ±0)`
		// Minimum execution time: 23_549_000 picoseconds.
		Weight::from_parts(25_244_311, 0)
			.saturating_add(Weight::from_parts(0, 3907))
			// Standard Error: 14_749
			.saturating_add(Weight::from_parts(6_512_737, 0).saturating_mul(m.into()))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(m.into())))
			.saturating_add(T::DbWeight::get().writes(1))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(m.into())))
			.saturating_add(Weight::from_parts(0, 2630).saturating_mul(m.into()))
	}
	/// Storage: `DID::Did` (r:2 w:0)
	/// Proof: `DID::Did` (`max_values`: None, `max_size`: Some(442), added: 2917, mode: `MaxEncodedLen`)
	/// Storage: `DID::Issuers` (r:1 w:0)
	/// Proof: `DID::Issuers` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
	/// Storage: `DID::CredentialsTypes` (r:1 w:0)
	/// Proof: `DID::CredentialsTypes` (`max_values`: Some(1), `max_size`: Some(1651), added: 2146, mode: `MaxEncodedLen`)
	/// Storage: `DID::IssuedCredentials` (r:50 w:50)
	/// Proof: `DID::IssuedCredentials` (`max_values`: None, `max_size`: Some(659), added: 3134, mode: `MaxEncodedLen`)
	/// The range of component `c` is `[0, 50]`.
	fn issue_credentials(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `377 + c * (6 ±0)`
		//  Estimated: `6824 + c * (3134 ±0)`
		// Minimum execution time: 36_744_000 picoseconds.
		Weight::from_parts(44_403_938, 0)
			.saturating_add(Weight::from_parts(0, 6824))
			// Standard Error: 13_843
			.saturating_add(Weight::from_parts(8_238_619, 0).saturating_mul(c.into()))
			.saturating_add(T::DbWeight::get().reads(4))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 3134).saturating_mul(c.into()))
	}
	/// Storage: `DID::Did` (r:1 w:0)
	/// Proof: `DID::Did` (`max_values`: None, `max_size`: Some(442), added: 2917, mode: `MaxEncodedLen`)
	/// Storage: `DID::IssuedCredentials` (r:50 w:50)
	/// Proof: `DID::IssuedCredentials` (`max_values`: None, `max_size`: Some(659), added: 3134, mode: `MaxEncodedLen`)
	/// The range of component `c` is `[0, 50]`.
	fn revoke_credentials(c: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `365 + c * (594 ±0)`
		//  Estimated: `3907 + c * (3134 ±0)`
		// Minimum execution time: 24_250_000 picoseconds.
		Weight::from_parts(34_299_684, 0)
			.saturating_add(Weight::from_parts(0, 3907))
			// Standard Error: 18_152
			.saturating_add(Weight::from_parts(10_610_305, 0).saturating_mul(c.into()))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(c.into())))
			.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(c.into())))
			.saturating_add(Weight::from_parts(0, 3134).saturating_mul(c.into()))
	}
	/// Storage: `DID::Did` (r:1 w:0)
	/// Proof: `DID::Did` (`max_values`: None, `max_size`: Some(442), added: 2917, mode: `MaxEncodedLen`)
	/// Storage: `DID::Issuers` (r:1 w:1)
	/// Proof: `DID::Issuers` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
	fn add_issuer() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `147`
		//  Estimated: `3907`
		// Minimum execution time: 26_105_000 picoseconds.
		Weight::from_parts(26_767_000, 0)
			.saturating_add(Weight::from_parts(0, 3907))
			.saturating_add(T::DbWeight::get().reads(2))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	/// Storage: `DID::Issuers` (r:1 w:1)
	/// Proof: `DID::Issuers` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
	fn revoke_issuer() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `151`
		//  Estimated: `3514`
		// Minimum execution time: 24_751_000 picoseconds.
		Weight::from_parts(25_373_000, 0)
			.saturating_add(Weight::from_parts(0, 3514))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	/// Storage: `DID::Issuers` (r:1 w:1)
	/// Proof: `DID::Issuers` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`)
	fn reactivate_issuer() -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `151`
		//  Estimated: `3514`
		// Minimum execution time: 22_288_000 picoseconds.
		Weight::from_parts(22_918_000, 0)
			.saturating_add(Weight::from_parts(0, 3514))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	/// Storage: `DID::CredentialsTypes` (r:1 w:1)
	/// Proof: `DID::CredentialsTypes` (`max_values`: Some(1), `max_size`: Some(1651), added: 2146, mode: `MaxEncodedLen`)
	/// The range of component `m` is `[0, 50]`.
	fn add_credentials_type(m: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `42`
		//  Estimated: `3136`
		// Minimum execution time: 17_760_000 picoseconds.
		Weight::from_parts(19_775_906, 0)
			.saturating_add(Weight::from_parts(0, 3136))
			// Standard Error: 3_686
			.saturating_add(Weight::from_parts(972_133, 0).saturating_mul(m.into()))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
	/// Storage: `DID::CredentialsTypes` (r:1 w:1)
	/// Proof: `DID::CredentialsTypes` (`max_values`: Some(1), `max_size`: Some(1651), added: 2146, mode: `MaxEncodedLen`)
	/// The range of component `m` is `[0, 50]`.
	fn remove_credentials_type(m: u32, ) -> Weight {
		// Proof Size summary in bytes:
		//  Measured:  `70 + m * (6 ±0)`
		//  Estimated: `3136`
		// Minimum execution time: 22_090_000 picoseconds.
		Weight::from_parts(23_014_184, 0)
			.saturating_add(Weight::from_parts(0, 3136))
			// Standard Error: 2_287
			.saturating_add(Weight::from_parts(748_453, 0).saturating_mul(m.into()))
			.saturating_add(T::DbWeight::get().reads(1))
			.saturating_add(T::DbWeight::get().writes(1))
	}
}
