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
14 RefungibleHandle, SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted,14 RefungibleHandle, SelfWeightOf, TokenData, weights::WeightInfo, TokensMinted,
15};15};
16
17macro_rules! max_weight_of {
18 ($($method:ident ($($args:tt)*)),*) => {
19 0
20 $(
21 .max(<SelfWeightOf<T>>::$method($($args)*))
22 )*
23 };
24}
1625
17pub struct CommonWeights<T: Config>(PhantomData<T>);26pub struct CommonWeights<T: Config>(PhantomData<T>);
18impl<T: Config> CommonWeightInfo for CommonWeights<T> {27impl<T: Config> CommonWeightInfo for CommonWeights<T> {
25 }34 }
2635
27 fn burn_item() -> Weight {36 fn burn_item() -> Weight {
28 <SelfWeightOf<T>>::burn_item()37 max_weight_of!(burn_item_partial(), burn_item_fully())
29 }38 }
3039
31 fn transfer() -> Weight {40 fn transfer() -> Weight {
41 max_weight_of!(
42 transfer_normal(),
43 transfer_creating(),
44 transfer_removing(),
32 <SelfWeightOf<T>>::transfer()45 transfer_creating_removing()
46 )
33 }47 }
3448
35 fn approve() -> Weight {49 fn approve() -> Weight {
36 <SelfWeightOf<T>>::approve()50 <SelfWeightOf<T>>::approve()
37 }51 }
3852
39 fn transfer_from() -> Weight {53 fn transfer_from() -> Weight {
54 max_weight_of!(
55 transfer_from_normal(),
56 transfer_from_creating(),
57 transfer_from_removing(),
40 <SelfWeightOf<T>>::transfer_from()58 transfer_from_creating_removing()
59 )
41 }60 }
4261
43 fn set_variable_metadata(_bytes: u32) -> Weight {62 fn set_variable_metadata(bytes: u32) -> Weight {
44 <SelfWeightOf<T>>::set_variable_metadata()63 <SelfWeightOf<T>>::set_variable_metadata(bytes)
45 }64 }
46}65}
4766
72 ) -> DispatchResultWithPostInfo {91 ) -> DispatchResultWithPostInfo {
73 with_weight(92 with_weight(
74 <Pallet<T>>::create_item(self, &sender, map_create_data(data, &to)?),93 <Pallet<T>>::create_item(self, &sender, map_create_data(data, &to)?),
75 <SelfWeightOf<T>>::create_item(),94 <CommonWeights<T>>::create_item(),
76 )95 )
77 }96 }
7897
90 let amount = data.len();109 let amount = data.len();
91 with_weight(110 with_weight(
92 <Pallet<T>>::create_multiple_items(self, &sender, data),111 <Pallet<T>>::create_multiple_items(self, &sender, data),
93 <SelfWeightOf<T>>::create_multiple_items(amount as u32),112 <CommonWeights<T>>::create_multiple_items(amount as u32),
94 )113 )
95 }114 }
96115
102 ) -> DispatchResultWithPostInfo {121 ) -> DispatchResultWithPostInfo {
103 with_weight(122 with_weight(
104 <Pallet<T>>::burn(self, &sender, token, amount),123 <Pallet<T>>::burn(self, &sender, token, amount),
105 <SelfWeightOf<T>>::burn_item(),124 <CommonWeights<T>>::burn_item(),
106 )125 )
107 }126 }
108127
115 ) -> DispatchResultWithPostInfo {134 ) -> DispatchResultWithPostInfo {
116 with_weight(135 with_weight(
117 <Pallet<T>>::transfer(&self, &from, &to, token, amount),136 <Pallet<T>>::transfer(&self, &from, &to, token, amount),
118 <SelfWeightOf<T>>::transfer(),137 <CommonWeights<T>>::transfer(),
119 )138 )
120 }139 }
121140
128 ) -> DispatchResultWithPostInfo {147 ) -> DispatchResultWithPostInfo {
129 with_weight(148 with_weight(
130 <Pallet<T>>::set_allowance(&self, &sender, &spender, token, amount),149 <Pallet<T>>::set_allowance(&self, &sender, &spender, token, amount),
131 <SelfWeightOf<T>>::approve(),150 <CommonWeights<T>>::approve(),
132 )151 )
133 }152 }
134153
142 ) -> DispatchResultWithPostInfo {161 ) -> DispatchResultWithPostInfo {
143 with_weight(162 with_weight(
144 <Pallet<T>>::transfer_from(&self, &sender, &from, &to, token, amount),163 <Pallet<T>>::transfer_from(&self, &sender, &from, &to, token, amount),
145 <SelfWeightOf<T>>::approve(),164 <CommonWeights<T>>::approve(),
146 )165 )
147 }166 }
148167
152 token: TokenId,171 token: TokenId,
153 data: Vec<u8>,172 data: Vec<u8>,
154 ) -> DispatchResultWithPostInfo {173 ) -> DispatchResultWithPostInfo {
174 let len = data.len();
155 with_weight(175 with_weight(
156 <Pallet<T>>::set_variable_metadata(&self, &sender, token, data),176 <Pallet<T>>::set_variable_metadata(&self, &sender, token, data),
157 <SelfWeightOf<T>>::set_variable_metadata(),177 <CommonWeights<T>>::set_variable_metadata(len as u32),
158 )178 )
159 }179 }
160180
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
--- a/pallets/refungible/src/weights.rs
+++ b/pallets/refungible/src/weights.rs
@@ -1,3 +1,27 @@
+// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs
+
+//! Autogenerated weights for pallet_refungible
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2021-10-21, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 128
+
+// Executed Command:
+// target/release/nft
+// benchmark
+// --pallet
+// pallet-refungible
+// --wasm-execution
+// compiled
+// --extrinsic
+// *
+// --template
+// .maintain/frame-weight-template.hbs
+// --steps=50
+// --repeat=20
+// --output=./pallets/refungible/src/weights.rs
+
+
 #![cfg_attr(rustfmt, rustfmt_skip)]
 #![allow(unused_parens)]
 #![allow(unused_imports)]
@@ -5,33 +29,273 @@
 use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
 use sp_std::marker::PhantomData;
 
+/// Weight functions needed for pallet_refungible.
 pub trait WeightInfo {
 	fn create_item() -> Weight;
-	fn create_multiple_items(b: u32) -> Weight;
-	fn burn_item() -> Weight;
-	fn transfer() -> Weight;
+	fn create_multiple_items(b: u32, ) -> Weight;
+	fn burn_item_partial() -> Weight;
+	fn burn_item_fully() -> Weight;
+	fn transfer_normal() -> Weight;
+	fn transfer_creating() -> Weight;
+	fn transfer_removing() -> Weight;
+	fn transfer_creating_removing() -> Weight;
 	fn approve() -> Weight;
-	fn transfer_from() -> Weight;
-	fn set_variable_metadata() -> Weight;
+	fn transfer_from_normal() -> Weight;
+	fn transfer_from_creating() -> Weight;
+	fn transfer_from_removing() -> Weight;
+	fn transfer_from_creating_removing() -> Weight;
+	fn set_variable_metadata(b: u32, ) -> Weight;
 }
 
+/// Weights for pallet_refungible using the Substrate node and recommended hardware.
 pub struct SubstrateWeight<T>(PhantomData<T>);
 impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
-    fn create_item() -> Weight {0}
-	fn create_multiple_items(_b: u32) -> Weight {0}
-	fn burn_item() -> Weight {0}
-	fn transfer() -> Weight {0}
-	fn approve() -> Weight {0}
-	fn transfer_from() -> Weight {0}
-	fn set_variable_metadata() -> Weight {0}
+	// Storage: Refungible TokensMinted (r:1 w:1)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Balance (r:0 w:1)
+	// Storage: Refungible TotalSupply (r:0 w:1)
+	// Storage: Refungible TokenData (r:0 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn create_item() -> Weight {
+		(18_681_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(2 as Weight))
+			.saturating_add(T::DbWeight::get().writes(6 as Weight))
+	}
+	// Storage: Refungible TokensMinted (r:1 w:1)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Balance (r:0 w:4)
+	// Storage: Refungible TotalSupply (r:0 w:4)
+	// Storage: Refungible TokenData (r:0 w:4)
+	// Storage: Refungible Owned (r:0 w:4)
+	fn create_multiple_items(b: u32, ) -> Weight {
+		(13_869_000 as Weight)
+			// Standard Error: 28_000
+			.saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))
+			.saturating_add(T::DbWeight::get().reads(2 as Weight))
+			.saturating_add(T::DbWeight::get().writes(2 as Weight))
+			.saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))
+	}
+	// Storage: Refungible TotalSupply (r:1 w:1)
+	// Storage: Refungible Balance (r:1 w:1)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn burn_item_partial() -> Weight {
+		(21_591_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(3 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
+	}
+	// Storage: Refungible TotalSupply (r:1 w:1)
+	// Storage: Refungible Balance (r:1 w:1)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible TokensBurnt (r:1 w:1)
+	// Storage: Refungible TokenData (r:0 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn burn_item_fully() -> Weight {
+		(29_257_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(6 as Weight))
+	}
+	// Storage: Refungible Balance (r:2 w:2)
+	fn transfer_normal() -> Weight {
+		(17_733_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(2 as Weight))
+			.saturating_add(T::DbWeight::get().writes(2 as Weight))
+	}
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn transfer_creating() -> Weight {
+		(20_943_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(3 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
+	}
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn transfer_removing() -> Weight {
+		(22_406_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(3 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
+	}
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:2 w:2)
+	// Storage: Refungible Owned (r:0 w:2)
+	fn transfer_creating_removing() -> Weight {
+		(24_762_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(6 as Weight))
+	}
+	// Storage: Refungible Balance (r:1 w:0)
+	// Storage: Refungible Allowance (r:0 w:1)
+	fn approve() -> Weight {
+		(14_109_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(1 as Weight))
+			.saturating_add(T::DbWeight::get().writes(1 as Weight))
+	}
+	// Storage: Refungible Allowance (r:1 w:1)
+	// Storage: Refungible Balance (r:2 w:2)
+	fn transfer_from_normal() -> Weight {
+		(25_348_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(3 as Weight))
+			.saturating_add(T::DbWeight::get().writes(3 as Weight))
+	}
+	// Storage: Refungible Allowance (r:1 w:1)
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn transfer_from_creating() -> Weight {
+		(28_647_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(5 as Weight))
+	}
+	// Storage: Refungible Allowance (r:1 w:1)
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn transfer_from_removing() -> Weight {
+		(30_472_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(5 as Weight))
+	}
+	// Storage: Refungible Allowance (r:1 w:1)
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:2 w:2)
+	// Storage: Refungible Owned (r:0 w:2)
+	fn transfer_from_creating_removing() -> Weight {
+		(32_362_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(5 as Weight))
+			.saturating_add(T::DbWeight::get().writes(7 as Weight))
+	}
+	// Storage: Refungible TokenData (r:1 w:1)
+	fn set_variable_metadata(_b: u32, ) -> Weight {
+		(6_801_000 as Weight)
+			.saturating_add(T::DbWeight::get().reads(1 as Weight))
+			.saturating_add(T::DbWeight::get().writes(1 as Weight))
+	}
 }
 
+// For backwards compatibility and tests
 impl WeightInfo for () {
-    fn create_item() -> Weight {0}
-	fn create_multiple_items(_b: u32) -> Weight {0}
-	fn burn_item() -> Weight {0}
-	fn transfer() -> Weight {0}
-	fn approve() -> Weight {0}
-	fn transfer_from() -> Weight {0}
-	fn set_variable_metadata() -> Weight {0}
+	// Storage: Refungible TokensMinted (r:1 w:1)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Balance (r:0 w:1)
+	// Storage: Refungible TotalSupply (r:0 w:1)
+	// Storage: Refungible TokenData (r:0 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn create_item() -> Weight {
+		(18_681_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(6 as Weight))
+	}
+	// Storage: Refungible TokensMinted (r:1 w:1)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Balance (r:0 w:4)
+	// Storage: Refungible TotalSupply (r:0 w:4)
+	// Storage: Refungible TokenData (r:0 w:4)
+	// Storage: Refungible Owned (r:0 w:4)
+	fn create_multiple_items(b: u32, ) -> Weight {
+		(13_869_000 as Weight)
+			// Standard Error: 28_000
+			.saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))
+			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
+			.saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))
+	}
+	// Storage: Refungible TotalSupply (r:1 w:1)
+	// Storage: Refungible Balance (r:1 w:1)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn burn_item_partial() -> Weight {
+		(21_591_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(3 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
+	}
+	// Storage: Refungible TotalSupply (r:1 w:1)
+	// Storage: Refungible Balance (r:1 w:1)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible TokensBurnt (r:1 w:1)
+	// Storage: Refungible TokenData (r:0 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn burn_item_fully() -> Weight {
+		(29_257_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(6 as Weight))
+	}
+	// Storage: Refungible Balance (r:2 w:2)
+	fn transfer_normal() -> Weight {
+		(17_733_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
+	}
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn transfer_creating() -> Weight {
+		(20_943_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(3 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
+	}
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn transfer_removing() -> Weight {
+		(22_406_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(3 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
+	}
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:2 w:2)
+	// Storage: Refungible Owned (r:0 w:2)
+	fn transfer_creating_removing() -> Weight {
+		(24_762_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(6 as Weight))
+	}
+	// Storage: Refungible Balance (r:1 w:0)
+	// Storage: Refungible Allowance (r:0 w:1)
+	fn approve() -> Weight {
+		(14_109_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
+	}
+	// Storage: Refungible Allowance (r:1 w:1)
+	// Storage: Refungible Balance (r:2 w:2)
+	fn transfer_from_normal() -> Weight {
+		(25_348_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(3 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(3 as Weight))
+	}
+	// Storage: Refungible Allowance (r:1 w:1)
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn transfer_from_creating() -> Weight {
+		(28_647_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(5 as Weight))
+	}
+	// Storage: Refungible Allowance (r:1 w:1)
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:1 w:1)
+	// Storage: Refungible Owned (r:0 w:1)
+	fn transfer_from_removing() -> Weight {
+		(30_472_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(5 as Weight))
+	}
+	// Storage: Refungible Allowance (r:1 w:1)
+	// Storage: Refungible Balance (r:2 w:2)
+	// Storage: Refungible AccountBalance (r:2 w:2)
+	// Storage: Refungible Owned (r:0 w:2)
+	fn transfer_from_creating_removing() -> Weight {
+		(32_362_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(5 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(7 as Weight))
+	}
+	// Storage: Refungible TokenData (r:1 w:1)
+	fn set_variable_metadata(_b: u32, ) -> Weight {
+		(6_801_000 as Weight)
+			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
+	}
 }