git.delta.rocks / unique-network / refs/commits / 1d469f4695cf

difftreelog

feat(refungible) benchmarking

Yaroslav Bolyukin2021-10-22parent: #4e1bd65.patch.diff
in: master

5 files changed

modifiedpallets/refungible/Cargo.tomldiffbeforeafterboth
--- a/pallets/refungible/Cargo.toml
+++ b/pallets/refungible/Cargo.toml
@@ -17,6 +17,7 @@
 sp-core = { default-features = false, version = '4.0.0-dev', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.10' }
 pallet-common = { default-features = false, path = '../common' }
 nft-data-structs = { default-features = false, path = '../../primitives/nft' }
+frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.10' }
 
 [features]
 default = ["std"]
@@ -27,5 +28,10 @@
     "sp-std/std",
     "nft-data-structs/std",
     "pallet-common/std",
+    'frame-benchmarking/std',
+]
+runtime-benchmarks = [
+    'frame-benchmarking',
+    'frame-support/runtime-benchmarks',
+    'frame-system/runtime-benchmarks',
 ]
-runtime-benchmarks = []
modifiedpallets/refungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/refungible/src/benchmarking.rs
+++ b/pallets/refungible/src/benchmarking.rs
@@ -1 +1,161 @@
-#![cfg(feature = "runtime-benchmarking")]
+use super::*;
+use crate::{Pallet, Config, RefungibleHandle};
+
+use sp_std::prelude::*;
+use pallet_common::benchmarking::{create_collection_raw, create_data};
+use frame_benchmarking::{benchmarks, account};
+use nft_data_structs::{CollectionMode, MAX_ITEMS_PER_BATCH};
+use pallet_common::bench_init;
+use core::convert::TryInto;
+use core::iter::IntoIterator;
+
+const SEED: u32 = 1;
+
+fn create_max_item_data<T: Config>(
+	users: impl IntoIterator<Item = (T::CrossAccountId, u128)>,
+) -> CreateItemData<T> {
+	let const_data = create_data(CUSTOM_DATA_LIMIT as usize).try_into().unwrap();
+	let variable_data = create_data(CUSTOM_DATA_LIMIT as usize).try_into().unwrap();
+	CreateItemData {
+		const_data,
+		variable_data,
+		users: users.into_iter().collect(),
+	}
+}
+fn create_max_item<T: Config>(
+	collection: &RefungibleHandle<T>,
+	sender: &T::CrossAccountId,
+	users: impl IntoIterator<Item = (T::CrossAccountId, u128)>,
+) -> Result<TokenId, DispatchError> {
+	<Pallet<T>>::create_item(&collection, sender, create_max_item_data(users))?;
+	Ok(TokenId(<TokensMinted<T>>::get(&collection.id)))
+}
+
+fn create_collection<T: Config>(owner: T::AccountId) -> Result<RefungibleHandle<T>, DispatchError> {
+	create_collection_raw(
+		owner,
+		CollectionMode::NFT,
+		<Pallet<T>>::init_collection,
+		RefungibleHandle::cast,
+	)
+}
+benchmarks! {
+	create_item {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			sender: cross_from_sub(owner); to: cross_sub;
+		};
+	}: {create_max_item(&collection, &sender, [(to.clone(), 200)])?}
+
+	create_multiple_items {
+		let b in 0..MAX_ITEMS_PER_BATCH;
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			sender: cross_from_sub(owner); to: cross_sub;
+		};
+		let data = (0..b).map(|_| create_max_item_data([(to.clone(), 200)])).collect();
+	}: {<Pallet<T>>::create_multiple_items(&collection, &sender, data)?}
+
+	// Other user left, token data is kept
+	burn_item_partial {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			sender: cross_from_sub(owner); burner: cross_sub; another_owner: cross_sub;
+		};
+		let item = create_max_item(&collection, &sender, [(burner.clone(), 200), (another_owner, 200)])?;
+	}: {<Pallet<T>>::burn(&collection, &burner, item, 200)?}
+	// No users remaining, token is destroyed
+	burn_item_fully {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			sender: cross_from_sub(owner); burner: cross_sub; another_owner: cross_sub;
+		};
+		let item = create_max_item(&collection, &sender, [(burner.clone(), 200)])?;
+	}: {<Pallet<T>>::burn(&collection, &burner, item, 200)?}
+
+	transfer_normal {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			sender: cross_from_sub(owner); receiver: cross_sub;
+		};
+		let item = create_max_item(&collection, &sender, [(sender.clone(), 200), (receiver.clone(), 200)])?;
+	}: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 100)?}
+	// Target account is created
+	transfer_creating {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			sender: cross_from_sub(owner); receiver: cross_sub;
+		};
+		let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;
+	}: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 100)?}
+	// Source account is destroyed
+	transfer_removing {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			sender: cross_from_sub(owner); receiver: cross_sub;
+		};
+		let item = create_max_item(&collection, &sender, [(sender.clone(), 200), (receiver.clone(), 200)])?;
+	}: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 200)?}
+	// Source account destroyed, target created
+	transfer_creating_removing {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			sender: cross_from_sub(owner); receiver: cross_sub;
+		};
+		let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;
+	}: {<Pallet<T>>::transfer(&collection, &sender, &receiver, item, 200)?}
+
+	approve {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			owner: cross_from_sub; sender: cross_sub; spender: cross_sub;
+		};
+		let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;
+	}: {<Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?}
+
+	transfer_from_normal {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;
+		};
+		let item = create_max_item(&collection, &owner, [(sender.clone(), 200), (receiver.clone(), 200)])?;
+		<Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?;
+	}: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 100)?}
+	// Target account is created
+	transfer_from_creating {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;
+		};
+		let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;
+		<Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 100)?;
+	}: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 100)?}
+	// Source account is destroyed
+	transfer_from_removing {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;
+		};
+		let item = create_max_item(&collection, &owner, [(sender.clone(), 200), (receiver.clone(), 200)])?;
+		<Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 200)?;
+	}: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 200)?}
+	// Source account destroyed, target created
+	transfer_from_creating_removing {
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			owner: cross_from_sub; sender: cross_sub; spender: cross_sub; receiver: cross_sub;
+		};
+		let item = create_max_item(&collection, &owner, [(sender.clone(), 200)])?;
+		<Pallet<T>>::set_allowance(&collection, &sender, &spender, item, 200)?;
+	}: {<Pallet<T>>::transfer_from(&collection, &spender, &sender, &receiver, item, 200)?}
+
+	set_variable_metadata {
+		let b in 0..CUSTOM_DATA_LIMIT;
+		bench_init!{
+			owner: sub; collection: collection(owner);
+			sender: cross_from_sub(owner);
+		};
+		let item = create_max_item(&collection, &sender, [(sender.clone(), 200)])?;
+		let data = create_data(b as usize);
+	}: {<Pallet<T>>::set_variable_metadata(&collection, &sender, item, data)?}
+}
modifiedpallets/refungible/src/common.rsdiffbeforeafterboth
--- a/pallets/refungible/src/common.rs
+++ b/pallets/refungible/src/common.rs
@@ -14,6 +14,15 @@
 	RefungibleHandle, SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted,
 };
 
+macro_rules! max_weight_of {
+	($($method:ident ($($args:tt)*)),*) => {
+		0
+		$(
+			.max(<SelfWeightOf<T>>::$method($($args)*))
+		)*
+	};
+}
+
 pub struct CommonWeights<T: Config>(PhantomData<T>);
 impl<T: Config> CommonWeightInfo for CommonWeights<T> {
 	fn create_item() -> Weight {
@@ -25,11 +34,16 @@
 	}
 
 	fn burn_item() -> Weight {
-		<SelfWeightOf<T>>::burn_item()
+		max_weight_of!(burn_item_partial(), burn_item_fully())
 	}
 
 	fn transfer() -> Weight {
-		<SelfWeightOf<T>>::transfer()
+		max_weight_of!(
+			transfer_normal(),
+			transfer_creating(),
+			transfer_removing(),
+			transfer_creating_removing()
+		)
 	}
 
 	fn approve() -> Weight {
@@ -37,11 +51,16 @@
 	}
 
 	fn transfer_from() -> Weight {
-		<SelfWeightOf<T>>::transfer_from()
+		max_weight_of!(
+			transfer_from_normal(),
+			transfer_from_creating(),
+			transfer_from_removing(),
+			transfer_from_creating_removing()
+		)
 	}
 
-	fn set_variable_metadata(_bytes: u32) -> Weight {
-		<SelfWeightOf<T>>::set_variable_metadata()
+	fn set_variable_metadata(bytes: u32) -> Weight {
+		<SelfWeightOf<T>>::set_variable_metadata(bytes)
 	}
 }
 
@@ -72,7 +91,7 @@
 	) -> DispatchResultWithPostInfo {
 		with_weight(
 			<Pallet<T>>::create_item(self, &sender, map_create_data(data, &to)?),
-			<SelfWeightOf<T>>::create_item(),
+			<CommonWeights<T>>::create_item(),
 		)
 	}
 
@@ -90,7 +109,7 @@
 		let amount = data.len();
 		with_weight(
 			<Pallet<T>>::create_multiple_items(self, &sender, data),
-			<SelfWeightOf<T>>::create_multiple_items(amount as u32),
+			<CommonWeights<T>>::create_multiple_items(amount as u32),
 		)
 	}
 
@@ -102,7 +121,7 @@
 	) -> DispatchResultWithPostInfo {
 		with_weight(
 			<Pallet<T>>::burn(self, &sender, token, amount),
-			<SelfWeightOf<T>>::burn_item(),
+			<CommonWeights<T>>::burn_item(),
 		)
 	}
 
@@ -115,7 +134,7 @@
 	) -> DispatchResultWithPostInfo {
 		with_weight(
 			<Pallet<T>>::transfer(&self, &from, &to, token, amount),
-			<SelfWeightOf<T>>::transfer(),
+			<CommonWeights<T>>::transfer(),
 		)
 	}
 
@@ -128,7 +147,7 @@
 	) -> DispatchResultWithPostInfo {
 		with_weight(
 			<Pallet<T>>::set_allowance(&self, &sender, &spender, token, amount),
-			<SelfWeightOf<T>>::approve(),
+			<CommonWeights<T>>::approve(),
 		)
 	}
 
@@ -142,7 +161,7 @@
 	) -> DispatchResultWithPostInfo {
 		with_weight(
 			<Pallet<T>>::transfer_from(&self, &sender, &from, &to, token, amount),
-			<SelfWeightOf<T>>::approve(),
+			<CommonWeights<T>>::approve(),
 		)
 	}
 
@@ -152,9 +171,10 @@
 		token: TokenId,
 		data: Vec<u8>,
 	) -> DispatchResultWithPostInfo {
+		let len = data.len();
 		with_weight(
 			<Pallet<T>>::set_variable_metadata(&self, &sender, token, data),
-			<SelfWeightOf<T>>::set_variable_metadata(),
+			<CommonWeights<T>>::set_variable_metadata(len as u32),
 		)
 	}
 
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -14,6 +14,7 @@
 use codec::{Encode, Decode};
 
 pub use pallet::*;
+#[cfg(feature = "runtime-benchmarks")]
 pub mod benchmarking;
 pub mod common;
 pub mod erc;
modifiedpallets/refungible/src/weights.rsdiffbeforeafterboth
before · pallets/refungible/src/weights.rs
1#![cfg_attr(rustfmt, rustfmt_skip)]2#![allow(unused_parens)]3#![allow(unused_imports)]45use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};6use sp_std::marker::PhantomData;78pub trait WeightInfo {9	fn create_item() -> Weight;10	fn create_multiple_items(b: u32) -> Weight;11	fn burn_item() -> Weight;12	fn transfer() -> Weight;13	fn approve() -> Weight;14	fn transfer_from() -> Weight;15	fn set_variable_metadata() -> Weight;16}1718pub struct SubstrateWeight<T>(PhantomData<T>);19impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {20    fn create_item() -> Weight {0}21	fn create_multiple_items(_b: u32) -> Weight {0}22	fn burn_item() -> Weight {0}23	fn transfer() -> Weight {0}24	fn approve() -> Weight {0}25	fn transfer_from() -> Weight {0}26	fn set_variable_metadata() -> Weight {0}27}2829impl WeightInfo for () {30    fn create_item() -> Weight {0}31	fn create_multiple_items(_b: u32) -> Weight {0}32	fn burn_item() -> Weight {0}33	fn transfer() -> Weight {0}34	fn approve() -> Weight {0}35	fn transfer_from() -> Weight {0}36	fn set_variable_metadata() -> Weight {0}37}
after · pallets/refungible/src/weights.rs
1// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs23//! Autogenerated weights for pallet_refungible4//!5//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev6//! DATE: 2021-10-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`7//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 12889// Executed Command:10// target/release/nft11// benchmark12// --pallet13// pallet-refungible14// --wasm-execution15// compiled16// --extrinsic17// *18// --template19// .maintain/frame-weight-template.hbs20// --steps=5021// --repeat=2022// --output=./pallets/refungible/src/weights.rs232425#![cfg_attr(rustfmt, rustfmt_skip)]26#![allow(unused_parens)]27#![allow(unused_imports)]2829use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};30use sp_std::marker::PhantomData;3132/// Weight functions needed for pallet_refungible.33pub trait WeightInfo {34	fn create_item() -> Weight;35	fn create_multiple_items(b: u32, ) -> Weight;36	fn burn_item_partial() -> Weight;37	fn burn_item_fully() -> Weight;38	fn transfer_normal() -> Weight;39	fn transfer_creating() -> Weight;40	fn transfer_removing() -> Weight;41	fn transfer_creating_removing() -> Weight;42	fn approve() -> Weight;43	fn transfer_from_normal() -> Weight;44	fn transfer_from_creating() -> Weight;45	fn transfer_from_removing() -> Weight;46	fn transfer_from_creating_removing() -> Weight;47	fn set_variable_metadata(b: u32, ) -> Weight;48}4950/// Weights for pallet_refungible using the Substrate node and recommended hardware.51pub struct SubstrateWeight<T>(PhantomData<T>);52impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {53	// Storage: Refungible TokensMinted (r:1 w:1)54	// Storage: Refungible AccountBalance (r:1 w:1)55	// Storage: Refungible Balance (r:0 w:1)56	// Storage: Refungible TotalSupply (r:0 w:1)57	// Storage: Refungible TokenData (r:0 w:1)58	// Storage: Refungible Owned (r:0 w:1)59	fn create_item() -> Weight {60		(18_681_000 as Weight)61			.saturating_add(T::DbWeight::get().reads(2 as Weight))62			.saturating_add(T::DbWeight::get().writes(6 as Weight))63	}64	// Storage: Refungible TokensMinted (r:1 w:1)65	// Storage: Refungible AccountBalance (r:1 w:1)66	// Storage: Refungible Balance (r:0 w:4)67	// Storage: Refungible TotalSupply (r:0 w:4)68	// Storage: Refungible TokenData (r:0 w:4)69	// Storage: Refungible Owned (r:0 w:4)70	fn create_multiple_items(b: u32, ) -> Weight {71		(13_869_000 as Weight)72			// Standard Error: 28_00073			.saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))74			.saturating_add(T::DbWeight::get().reads(2 as Weight))75			.saturating_add(T::DbWeight::get().writes(2 as Weight))76			.saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))77	}78	// Storage: Refungible TotalSupply (r:1 w:1)79	// Storage: Refungible Balance (r:1 w:1)80	// Storage: Refungible AccountBalance (r:1 w:1)81	// Storage: Refungible Owned (r:0 w:1)82	fn burn_item_partial() -> Weight {83		(21_591_000 as Weight)84			.saturating_add(T::DbWeight::get().reads(3 as Weight))85			.saturating_add(T::DbWeight::get().writes(4 as Weight))86	}87	// Storage: Refungible TotalSupply (r:1 w:1)88	// Storage: Refungible Balance (r:1 w:1)89	// Storage: Refungible AccountBalance (r:1 w:1)90	// Storage: Refungible TokensBurnt (r:1 w:1)91	// Storage: Refungible TokenData (r:0 w:1)92	// Storage: Refungible Owned (r:0 w:1)93	fn burn_item_fully() -> Weight {94		(29_257_000 as Weight)95			.saturating_add(T::DbWeight::get().reads(4 as Weight))96			.saturating_add(T::DbWeight::get().writes(6 as Weight))97	}98	// Storage: Refungible Balance (r:2 w:2)99	fn transfer_normal() -> Weight {100		(17_733_000 as Weight)101			.saturating_add(T::DbWeight::get().reads(2 as Weight))102			.saturating_add(T::DbWeight::get().writes(2 as Weight))103	}104	// Storage: Refungible Balance (r:2 w:2)105	// Storage: Refungible AccountBalance (r:1 w:1)106	// Storage: Refungible Owned (r:0 w:1)107	fn transfer_creating() -> Weight {108		(20_943_000 as Weight)109			.saturating_add(T::DbWeight::get().reads(3 as Weight))110			.saturating_add(T::DbWeight::get().writes(4 as Weight))111	}112	// Storage: Refungible Balance (r:2 w:2)113	// Storage: Refungible AccountBalance (r:1 w:1)114	// Storage: Refungible Owned (r:0 w:1)115	fn transfer_removing() -> Weight {116		(22_406_000 as Weight)117			.saturating_add(T::DbWeight::get().reads(3 as Weight))118			.saturating_add(T::DbWeight::get().writes(4 as Weight))119	}120	// Storage: Refungible Balance (r:2 w:2)121	// Storage: Refungible AccountBalance (r:2 w:2)122	// Storage: Refungible Owned (r:0 w:2)123	fn transfer_creating_removing() -> Weight {124		(24_762_000 as Weight)125			.saturating_add(T::DbWeight::get().reads(4 as Weight))126			.saturating_add(T::DbWeight::get().writes(6 as Weight))127	}128	// Storage: Refungible Balance (r:1 w:0)129	// Storage: Refungible Allowance (r:0 w:1)130	fn approve() -> Weight {131		(14_109_000 as Weight)132			.saturating_add(T::DbWeight::get().reads(1 as Weight))133			.saturating_add(T::DbWeight::get().writes(1 as Weight))134	}135	// Storage: Refungible Allowance (r:1 w:1)136	// Storage: Refungible Balance (r:2 w:2)137	fn transfer_from_normal() -> Weight {138		(25_348_000 as Weight)139			.saturating_add(T::DbWeight::get().reads(3 as Weight))140			.saturating_add(T::DbWeight::get().writes(3 as Weight))141	}142	// Storage: Refungible Allowance (r:1 w:1)143	// Storage: Refungible Balance (r:2 w:2)144	// Storage: Refungible AccountBalance (r:1 w:1)145	// Storage: Refungible Owned (r:0 w:1)146	fn transfer_from_creating() -> Weight {147		(28_647_000 as Weight)148			.saturating_add(T::DbWeight::get().reads(4 as Weight))149			.saturating_add(T::DbWeight::get().writes(5 as Weight))150	}151	// Storage: Refungible Allowance (r:1 w:1)152	// Storage: Refungible Balance (r:2 w:2)153	// Storage: Refungible AccountBalance (r:1 w:1)154	// Storage: Refungible Owned (r:0 w:1)155	fn transfer_from_removing() -> Weight {156		(30_472_000 as Weight)157			.saturating_add(T::DbWeight::get().reads(4 as Weight))158			.saturating_add(T::DbWeight::get().writes(5 as Weight))159	}160	// Storage: Refungible Allowance (r:1 w:1)161	// Storage: Refungible Balance (r:2 w:2)162	// Storage: Refungible AccountBalance (r:2 w:2)163	// Storage: Refungible Owned (r:0 w:2)164	fn transfer_from_creating_removing() -> Weight {165		(32_362_000 as Weight)166			.saturating_add(T::DbWeight::get().reads(5 as Weight))167			.saturating_add(T::DbWeight::get().writes(7 as Weight))168	}169	// Storage: Refungible TokenData (r:1 w:1)170	fn set_variable_metadata(_b: u32, ) -> Weight {171		(6_801_000 as Weight)172			.saturating_add(T::DbWeight::get().reads(1 as Weight))173			.saturating_add(T::DbWeight::get().writes(1 as Weight))174	}175}176177// For backwards compatibility and tests178impl WeightInfo for () {179	// Storage: Refungible TokensMinted (r:1 w:1)180	// Storage: Refungible AccountBalance (r:1 w:1)181	// Storage: Refungible Balance (r:0 w:1)182	// Storage: Refungible TotalSupply (r:0 w:1)183	// Storage: Refungible TokenData (r:0 w:1)184	// Storage: Refungible Owned (r:0 w:1)185	fn create_item() -> Weight {186		(18_681_000 as Weight)187			.saturating_add(RocksDbWeight::get().reads(2 as Weight))188			.saturating_add(RocksDbWeight::get().writes(6 as Weight))189	}190	// Storage: Refungible TokensMinted (r:1 w:1)191	// Storage: Refungible AccountBalance (r:1 w:1)192	// Storage: Refungible Balance (r:0 w:4)193	// Storage: Refungible TotalSupply (r:0 w:4)194	// Storage: Refungible TokenData (r:0 w:4)195	// Storage: Refungible Owned (r:0 w:4)196	fn create_multiple_items(b: u32, ) -> Weight {197		(13_869_000 as Weight)198			// Standard Error: 28_000199			.saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))200			.saturating_add(RocksDbWeight::get().reads(2 as Weight))201			.saturating_add(RocksDbWeight::get().writes(2 as Weight))202			.saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))203	}204	// Storage: Refungible TotalSupply (r:1 w:1)205	// Storage: Refungible Balance (r:1 w:1)206	// Storage: Refungible AccountBalance (r:1 w:1)207	// Storage: Refungible Owned (r:0 w:1)208	fn burn_item_partial() -> Weight {209		(21_591_000 as Weight)210			.saturating_add(RocksDbWeight::get().reads(3 as Weight))211			.saturating_add(RocksDbWeight::get().writes(4 as Weight))212	}213	// Storage: Refungible TotalSupply (r:1 w:1)214	// Storage: Refungible Balance (r:1 w:1)215	// Storage: Refungible AccountBalance (r:1 w:1)216	// Storage: Refungible TokensBurnt (r:1 w:1)217	// Storage: Refungible TokenData (r:0 w:1)218	// Storage: Refungible Owned (r:0 w:1)219	fn burn_item_fully() -> Weight {220		(29_257_000 as Weight)221			.saturating_add(RocksDbWeight::get().reads(4 as Weight))222			.saturating_add(RocksDbWeight::get().writes(6 as Weight))223	}224	// Storage: Refungible Balance (r:2 w:2)225	fn transfer_normal() -> Weight {226		(17_733_000 as Weight)227			.saturating_add(RocksDbWeight::get().reads(2 as Weight))228			.saturating_add(RocksDbWeight::get().writes(2 as Weight))229	}230	// Storage: Refungible Balance (r:2 w:2)231	// Storage: Refungible AccountBalance (r:1 w:1)232	// Storage: Refungible Owned (r:0 w:1)233	fn transfer_creating() -> Weight {234		(20_943_000 as Weight)235			.saturating_add(RocksDbWeight::get().reads(3 as Weight))236			.saturating_add(RocksDbWeight::get().writes(4 as Weight))237	}238	// Storage: Refungible Balance (r:2 w:2)239	// Storage: Refungible AccountBalance (r:1 w:1)240	// Storage: Refungible Owned (r:0 w:1)241	fn transfer_removing() -> Weight {242		(22_406_000 as Weight)243			.saturating_add(RocksDbWeight::get().reads(3 as Weight))244			.saturating_add(RocksDbWeight::get().writes(4 as Weight))245	}246	// Storage: Refungible Balance (r:2 w:2)247	// Storage: Refungible AccountBalance (r:2 w:2)248	// Storage: Refungible Owned (r:0 w:2)249	fn transfer_creating_removing() -> Weight {250		(24_762_000 as Weight)251			.saturating_add(RocksDbWeight::get().reads(4 as Weight))252			.saturating_add(RocksDbWeight::get().writes(6 as Weight))253	}254	// Storage: Refungible Balance (r:1 w:0)255	// Storage: Refungible Allowance (r:0 w:1)256	fn approve() -> Weight {257		(14_109_000 as Weight)258			.saturating_add(RocksDbWeight::get().reads(1 as Weight))259			.saturating_add(RocksDbWeight::get().writes(1 as Weight))260	}261	// Storage: Refungible Allowance (r:1 w:1)262	// Storage: Refungible Balance (r:2 w:2)263	fn transfer_from_normal() -> Weight {264		(25_348_000 as Weight)265			.saturating_add(RocksDbWeight::get().reads(3 as Weight))266			.saturating_add(RocksDbWeight::get().writes(3 as Weight))267	}268	// Storage: Refungible Allowance (r:1 w:1)269	// Storage: Refungible Balance (r:2 w:2)270	// Storage: Refungible AccountBalance (r:1 w:1)271	// Storage: Refungible Owned (r:0 w:1)272	fn transfer_from_creating() -> Weight {273		(28_647_000 as Weight)274			.saturating_add(RocksDbWeight::get().reads(4 as Weight))275			.saturating_add(RocksDbWeight::get().writes(5 as Weight))276	}277	// Storage: Refungible Allowance (r:1 w:1)278	// Storage: Refungible Balance (r:2 w:2)279	// Storage: Refungible AccountBalance (r:1 w:1)280	// Storage: Refungible Owned (r:0 w:1)281	fn transfer_from_removing() -> Weight {282		(30_472_000 as Weight)283			.saturating_add(RocksDbWeight::get().reads(4 as Weight))284			.saturating_add(RocksDbWeight::get().writes(5 as Weight))285	}286	// Storage: Refungible Allowance (r:1 w:1)287	// Storage: Refungible Balance (r:2 w:2)288	// Storage: Refungible AccountBalance (r:2 w:2)289	// Storage: Refungible Owned (r:0 w:2)290	fn transfer_from_creating_removing() -> Weight {291		(32_362_000 as Weight)292			.saturating_add(RocksDbWeight::get().reads(5 as Weight))293			.saturating_add(RocksDbWeight::get().writes(7 as Weight))294	}295	// Storage: Refungible TokenData (r:1 w:1)296	fn set_variable_metadata(_b: u32, ) -> Weight {297		(6_801_000 as Weight)298			.saturating_add(RocksDbWeight::get().reads(1 as Weight))299			.saturating_add(RocksDbWeight::get().writes(1 as Weight))300	}301}