git.delta.rocks / unique-network / refs/commits / ba69054f3875

difftreelog

style fix clippy warnings

Yaroslav Bolyukin2021-11-26parent: #d1696cc.patch.diff
in: master

26 files changed

modified.maintain/frame-weight-template.hbsdiffbeforeafterboth
--- a/.maintain/frame-weight-template.hbs
+++ b/.maintain/frame-weight-template.hbs
@@ -14,6 +14,7 @@
 #![cfg_attr(rustfmt, rustfmt_skip)]
 #![allow(unused_parens)]
 #![allow(unused_imports)]
+#![allow(clippy::unnecessary_cast)]
 
 use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
 use sp_std::marker::PhantomData;
modifiedMakefilediffbeforeafterboth
--- a/Makefile
+++ b/Makefile
@@ -57,9 +57,5 @@
 bench-nonfungible:
 	make _bench PALLET=nonfungible
 
-.PHONY: bench-evm-coder-substrate
-bench-evm-coder-substrate:
-	make _bench PALLET=evm-coder-substrate
-
 .PHONY: bench
-bench: bench-evm-migration bench-nft bench-fungible bench-refungible bench-nonfungible bench-evm-coder-substrate
+bench: bench-evm-migration bench-nft bench-fungible bench-refungible bench-nonfungible
modifiedcrates/evm-coder-macros/src/solidity_interface.rsdiffbeforeafterboth
--- a/crates/evm-coder-macros/src/solidity_interface.rs
+++ b/crates/evm-coder-macros/src/solidity_interface.rs
@@ -226,16 +226,10 @@
 		}
 	}
 	fn is_value(&self) -> bool {
-		match self {
-			Self::Plain(v) if v == "value" => true,
-			_ => false,
-		}
+		matches!(self, Self::Plain(v) if v == "value")
 	}
 	fn is_caller(&self) -> bool {
-		match self {
-			Self::Plain(v) if v == "caller" => true,
-			_ => false,
-		}
+		matches!(self, Self::Plain(v) if v == "caller")
 	}
 	fn is_special(&self) -> bool {
 		self.is_caller() || self.is_value()
@@ -599,7 +593,7 @@
 						#args,
 					)*
 				)?;
-				(&result).into_result()
+				(&result).to_result()
 			}
 		}
 	}
modifiedcrates/evm-coder/src/abi.rsdiffbeforeafterboth
--- a/crates/evm-coder/src/abi.rs
+++ b/crates/evm-coder/src/abi.rs
@@ -310,7 +310,7 @@
 
 pub trait AbiWrite {
 	fn abi_write(&self, writer: &mut AbiWriter);
-	fn into_result(&self) -> ResultWithPostInfo<AbiWriter> {
+	fn to_result(&self) -> ResultWithPostInfo<AbiWriter> {
 		let mut writer = AbiWriter::new();
 		self.abi_write(&mut writer);
 		Ok(writer.into())
@@ -319,7 +319,7 @@
 
 impl<T: AbiWrite> AbiWrite for ResultWithPostInfo<T> {
 	// this particular AbiWrite implementation should be split to another trait,
-	// which only implements [`into_result`]
+	// which only implements [`to_result`]
 	//
 	// But due to lack of specialization feature in stable Rust, we can't have
 	// blanket impl of this trait `for T where T: AbiWrite`, so here we abusing
@@ -327,7 +327,7 @@
 	fn abi_write(&self, _writer: &mut AbiWriter) {
 		debug_assert!(false, "shouldn't be called, see comment")
 	}
-	fn into_result(&self) -> ResultWithPostInfo<AbiWriter> {
+	fn to_result(&self) -> ResultWithPostInfo<AbiWriter> {
 		match self {
 			Ok(v) => Ok(WithPostDispatchInfo {
 				post_info: v.post_info.clone(),
modifiednode/rpc/src/lib.rsdiffbeforeafterboth
--- a/node/rpc/src/lib.rs
+++ b/node/rpc/src/lib.rs
@@ -214,7 +214,7 @@
 			500_usize, // max stored filters
 			overrides.clone(),
 			max_past_logs,
-			block_data_cache.clone(),
+			block_data_cache,
 		)));
 	}
 
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -51,7 +51,7 @@
 		Self::new_with_gas_limit(id, u64::MAX)
 	}
 	pub fn try_get(id: CollectionId) -> Result<Self, DispatchError> {
-		Ok(Self::new(id).ok_or_else(|| <Error<T>>::CollectionNotFound)?)
+		Ok(Self::new(id).ok_or(<Error<T>>::CollectionNotFound)?)
 	}
 	pub fn log(&self, log: impl evm_coder::ToLog) {
 		self.recorder.log(log)
@@ -453,7 +453,7 @@
 			collection.limits.owner_can_destroy(),
 			<Error<T>>::NoPermission,
 		);
-		collection.check_is_owner(&sender)?;
+		collection.check_is_owner(sender)?;
 
 		let destroyed_collections = <DestroyedCollectionCount<T>>::get()
 			.0
@@ -476,7 +476,7 @@
 		user: &T::CrossAccountId,
 		allowed: bool,
 	) -> DispatchResult {
-		collection.check_is_owner_or_admin(&sender)?;
+		collection.check_is_owner_or_admin(sender)?;
 
 		// =========
 
@@ -495,7 +495,7 @@
 		user: &T::CrossAccountId,
 		admin: bool,
 	) -> DispatchResult {
-		collection.check_is_owner_or_admin(&sender)?;
+		collection.check_is_owner_or_admin(sender)?;
 
 		let was_admin = <IsAdmin<T>>::get((collection.id, user));
 		if was_admin == admin {
modifiedpallets/evm-contract-helpers/exp.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/exp.rs
+++ b/pallets/evm-contract-helpers/exp.rs
@@ -532,11 +532,11 @@
             match c.call {
                 InternalCall::ContractOwner { contract_address } => {
                     let result = self.contract_owner(contract_address)?;
-                    (&result).into_result()
+                    (&result).to_result()
                 }
                 InternalCall::SponsoringEnabled { contract_address } => {
                     let result = self.sponsoring_enabled(contract_address)?;
-                    (&result).into_result()
+                    (&result).to_result()
                 }
                 InternalCall::ToggleSponsoring {
                     contract_address,
@@ -544,7 +544,7 @@
                 } => {
                     let result =
                         self.toggle_sponsoring(c.caller.clone(), contract_address, enabled)?;
-                    (&result).into_result()
+                    (&result).to_result()
                 }
                 InternalCall::SetSponsoringRateLimit {
                     contract_address,
@@ -555,22 +555,22 @@
                         contract_address,
                         rate_limit,
                     )?;
-                    (&result).into_result()
+                    (&result).to_result()
                 }
                 InternalCall::GetSponsoringRateLimit { contract_address } => {
                     let result = self.get_sponsoring_rate_limit(contract_address)?;
-                    (&result).into_result()
+                    (&result).to_result()
                 }
                 InternalCall::Allowed {
                     contract_address,
                     user,
                 } => {
                     let result = self.allowed(contract_address, user)?;
-                    (&result).into_result()
+                    (&result).to_result()
                 }
                 InternalCall::AllowlistEnabled { contract_address } => {
                     let result = self.allowlist_enabled(contract_address)?;
-                    (&result).into_result()
+                    (&result).to_result()
                 }
                 InternalCall::ToggleAllowlist {
                     contract_address,
@@ -578,7 +578,7 @@
                 } => {
                     let result =
                         self.toggle_allowlist(c.caller.clone(), contract_address, enabled)?;
-                    (&result).into_result()
+                    (&result).to_result()
                 }
                 InternalCall::ToggleAllowed {
                     contract_address,
@@ -587,7 +587,7 @@
                 } => {
                     let result =
                         self.toggle_allowed(c.caller.clone(), contract_address, user, allowed)?;
-                    (&result).into_result()
+                    (&result).to_result()
                 }
                 _ => ::core::panicking::panic("internal error: entered unreachable code"),
             }
modifiedpallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth
--- a/pallets/evm-contract-helpers/src/eth.rs
+++ b/pallets/evm-contract-helpers/src/eth.rs
@@ -1,10 +1,7 @@
 use core::marker::PhantomData;
 use evm_coder::{abi::AbiWriter, execution::Result, generate_stubgen, solidity_interface, types::*};
 use pallet_evm_coder_substrate::{SubstrateRecorder, WithRecorder};
-use pallet_evm::{
-	ExitReason, ExitRevert, OnCreate, OnMethodCall, PrecompileOutput, PrecompileResult,
-	PrecompileFailure,
-};
+use pallet_evm::{ExitRevert, OnCreate, OnMethodCall, PrecompileResult, PrecompileFailure};
 use sp_core::H160;
 use crate::{
 	AllowlistEnabled, Config, Owner, Pallet, SelfSponsoring, SponsorBasket, SponsoringRateLimit,
@@ -161,7 +158,7 @@
 		if let Some(last_tx_block) = <SponsorBasket<T>>::get(&call.0, who) {
 			let limit = <SponsoringRateLimit<T>>::get(&call.0);
 
-			let timeout = last_tx_block + limit.into();
+			let timeout = last_tx_block + limit;
 			if block_number < timeout {
 				return None;
 			}
modifiedpallets/evm-migration/src/weights.rsdiffbeforeafterboth
--- a/pallets/evm-migration/src/weights.rs
+++ b/pallets/evm-migration/src/weights.rs
@@ -25,6 +25,7 @@
 #![cfg_attr(rustfmt, rustfmt_skip)]
 #![allow(unused_parens)]
 #![allow(unused_imports)]
+#![allow(clippy::unnecessary_cast)]
 
 use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
 use sp_std::marker::PhantomData;
modifiedpallets/evm-transaction-payment/src/lib.rsdiffbeforeafterboth
--- a/pallets/evm-transaction-payment/src/lib.rs
+++ b/pallets/evm-transaction-payment/src/lib.rs
@@ -128,7 +128,7 @@
 				let sponsor = frame_support::storage::with_transaction(|| {
 					TransactionOutcome::Rollback(T::EvmSponsorshipHandler::get_sponsor(
 						&who,
-						&(target.clone(), input.clone()),
+						&(*target, input.clone()),
 					))
 				})?;
 				let sponsor = T::EvmAddressMapping::into_account_id(sponsor);
modifiedpallets/fungible/src/common.rsdiffbeforeafterboth
--- a/pallets/fungible/src/common.rs
+++ b/pallets/fungible/src/common.rs
@@ -116,7 +116,7 @@
 		);
 
 		with_weight(
-			<Pallet<T>>::transfer(&self, &from, &to, amount),
+			<Pallet<T>>::transfer(self, &from, &to, amount),
 			<CommonWeights<T>>::transfer(),
 		)
 	}
@@ -134,7 +134,7 @@
 		);
 
 		with_weight(
-			<Pallet<T>>::set_allowance(&self, &sender, &spender, amount),
+			<Pallet<T>>::set_allowance(self, &sender, &spender, amount),
 			<CommonWeights<T>>::approve(),
 		)
 	}
@@ -153,7 +153,7 @@
 		);
 
 		with_weight(
-			<Pallet<T>>::transfer_from(&self, &sender, &from, &to, amount),
+			<Pallet<T>>::transfer_from(self, &sender, &from, &to, amount),
 			<CommonWeights<T>>::transfer_from(),
 		)
 	}
@@ -171,7 +171,7 @@
 		);
 
 		with_weight(
-			<Pallet<T>>::burn_from(&self, &sender, &from, amount),
+			<Pallet<T>>::burn_from(self, &sender, &from, amount),
 			<CommonWeights<T>>::burn_from(),
 		)
 	}
modifiedpallets/fungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/fungible/src/erc.rs
+++ b/pallets/fungible/src/erc.rs
@@ -6,7 +6,6 @@
 use sp_core::{H160, U256};
 use sp_std::vec::Vec;
 use pallet_common::account::CrossAccountId;
-use pallet_common::erc::PrecompileOutput;
 use pallet_evm_coder_substrate::{call, dispatch_to_evm};
 
 use crate::{
modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/fungible/src/lib.rs
+++ b/pallets/fungible/src/lib.rs
@@ -303,8 +303,8 @@
 		amount: u128,
 	) -> DispatchResult {
 		if collection.access == AccessMode::AllowList {
-			collection.check_allowlist(&owner)?;
-			collection.check_allowlist(&spender)?;
+			collection.check_allowlist(owner)?;
+			collection.check_allowlist(spender)?;
 		}
 
 		if <Balance<T>>::get((collection.id, owner)) < amount {
modifiedpallets/fungible/src/weights.rsdiffbeforeafterboth
--- a/pallets/fungible/src/weights.rs
+++ b/pallets/fungible/src/weights.rs
@@ -25,6 +25,7 @@
 #![cfg_attr(rustfmt, rustfmt_skip)]
 #![allow(unused_parens)]
 #![allow(unused_imports)]
+#![allow(clippy::unnecessary_cast)]
 
 use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
 use sp_std::marker::PhantomData;
@@ -32,11 +33,11 @@
 /// Weight functions needed for pallet_fungible.
 pub trait WeightInfo {
 	fn create_item() -> Weight;
-	fn burn_from() -> Weight;
 	fn burn_item() -> Weight;
 	fn transfer() -> Weight;
 	fn approve() -> Weight;
 	fn transfer_from() -> Weight;
+	fn burn_from() -> Weight;
 }
 
 /// Weights for pallet_fungible using the Substrate node and recommended hardware.
modifiedpallets/nft/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/nft/src/benchmarking.rs
+++ b/pallets/nft/src/benchmarking.rs
@@ -158,6 +158,7 @@
 			sponsored_data_size: Some(0),
 			token_limit: Some(1),
 			sponsor_transfer_timeout: Some(0),
+			sponsor_approve_timeout: None,
 			owner_can_destroy: Some(true),
 			owner_can_transfer: Some(true),
 			sponsored_data_rate_limit: None,
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -195,7 +195,7 @@
 
 			// Create new collection
 			let new_collection = Collection {
-				owner: who.clone(),
+				owner: who,
 				name: collection_name,
 				mode: mode.clone(),
 				mint_mode: false,
modifiedpallets/nft/src/weights.rsdiffbeforeafterboth
--- a/pallets/nft/src/weights.rs
+++ b/pallets/nft/src/weights.rs
@@ -25,6 +25,7 @@
 #![cfg_attr(rustfmt, rustfmt_skip)]
 #![allow(unused_parens)]
 #![allow(unused_imports)]
+#![allow(clippy::unnecessary_cast)]
 
 use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
 use sp_std::marker::PhantomData;
modifiedpallets/nonfungible/src/common.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/common.rs
+++ b/pallets/nonfungible/src/common.rs
@@ -100,7 +100,7 @@
 		ensure!(amount <= 1, <Error<T>>::NonfungibleItemsHaveNoAmount);
 		if amount == 1 {
 			with_weight(
-				<Pallet<T>>::burn(&self, &sender, token),
+				<Pallet<T>>::burn(self, &sender, token),
 				<CommonWeights<T>>::burn_item(),
 			)
 		} else {
@@ -118,7 +118,7 @@
 		ensure!(amount <= 1, <Error<T>>::NonfungibleItemsHaveNoAmount);
 		if amount == 1 {
 			with_weight(
-				<Pallet<T>>::transfer(&self, &from, &to, token),
+				<Pallet<T>>::transfer(self, &from, &to, token),
 				<CommonWeights<T>>::transfer(),
 			)
 		} else {
@@ -137,9 +137,9 @@
 
 		with_weight(
 			if amount == 1 {
-				<Pallet<T>>::set_allowance(&self, &sender, token, Some(&spender))
+				<Pallet<T>>::set_allowance(self, &sender, token, Some(&spender))
 			} else {
-				<Pallet<T>>::set_allowance(&self, &sender, token, None)
+				<Pallet<T>>::set_allowance(self, &sender, token, None)
 			},
 			<CommonWeights<T>>::approve(),
 		)
@@ -157,7 +157,7 @@
 
 		if amount == 1 {
 			with_weight(
-				<Pallet<T>>::transfer_from(&self, &sender, &from, &to, token),
+				<Pallet<T>>::transfer_from(self, &sender, &from, &to, token),
 				<CommonWeights<T>>::transfer_from(),
 			)
 		} else {
@@ -176,7 +176,7 @@
 
 		if amount == 1 {
 			with_weight(
-				<Pallet<T>>::burn_from(&self, &sender, &from, token),
+				<Pallet<T>>::burn_from(self, &sender, &from, token),
 				<CommonWeights<T>>::burn_from(),
 			)
 		} else {
@@ -192,7 +192,7 @@
 	) -> DispatchResultWithPostInfo {
 		let len = data.len();
 		with_weight(
-			<Pallet<T>>::set_variable_metadata(&self, &sender, token, data),
+			<Pallet<T>>::set_variable_metadata(self, &sender, token, data),
 			<CommonWeights<T>>::set_variable_metadata(len as u32),
 		)
 	}
@@ -218,12 +218,12 @@
 	}
 	fn const_metadata(&self, token: TokenId) -> Vec<u8> {
 		<TokenData<T>>::get((self.id, token))
-			.map(|t| t.const_data.clone())
+			.map(|t| t.const_data)
 			.unwrap_or_default()
 	}
 	fn variable_metadata(&self, token: TokenId) -> Vec<u8> {
 		<TokenData<T>>::get((self.id, token))
-			.map(|t| t.variable_data.clone())
+			.map(|t| t.variable_data)
 			.unwrap_or_default()
 	}
 
modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/erc.rs
+++ b/pallets/nonfungible/src/erc.rs
@@ -13,7 +13,6 @@
 	erc::{CommonEvmHandler, PrecompileResult},
 };
 use pallet_evm_coder_substrate::call;
-use pallet_common::erc::PrecompileOutput;
 
 use crate::{
 	AccountBalance, Config, CreateItemData, NonfungibleHandle, Pallet, TokenData, TokensMinted,
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -169,8 +169,8 @@
 		sender: &T::CrossAccountId,
 		token: TokenId,
 	) -> DispatchResult {
-		let token_data = <TokenData<T>>::get((collection.id, token))
-			.ok_or_else(|| <CommonError<T>>::TokenNotFound)?;
+		let token_data =
+			<TokenData<T>>::get((collection.id, token)).ok_or(<CommonError<T>>::TokenNotFound)?;
 		ensure!(
 			&token_data.owner == sender
 				|| (collection.limits.owner_can_transfer() && collection.is_owner_or_admin(sender)),
@@ -197,7 +197,7 @@
 				collection.id,
 				token,
 				sender.clone(),
-				old_spender.clone(),
+				old_spender,
 				0,
 			));
 		}
@@ -213,7 +213,7 @@
 			token_data.owner,
 			1,
 		));
-		return Ok(());
+		Ok(())
 	}
 
 	pub fn transfer(
@@ -227,8 +227,8 @@
 			<CommonError<T>>::TransferNotAllowed
 		);
 
-		let token_data = <TokenData<T>>::get((collection.id, token))
-			.ok_or_else(|| <CommonError<T>>::TokenNotFound)?;
+		let token_data =
+			<TokenData<T>>::get((collection.id, token)).ok_or(<CommonError<T>>::TokenNotFound)?;
 		ensure!(
 			&token_data.owner == from
 				|| (collection.limits.owner_can_transfer() && collection.is_owner_or_admin(from)),
@@ -399,7 +399,7 @@
 						collection.id,
 						token,
 						sender.clone(),
-						old_owner.clone(),
+						old_owner,
 						0,
 					));
 				}
@@ -429,7 +429,7 @@
 					collection.id,
 					token,
 					sender.clone(),
-					old_spender.clone(),
+					old_spender,
 					0,
 				));
 			}
@@ -443,9 +443,9 @@
 		spender: Option<&T::CrossAccountId>,
 	) -> DispatchResult {
 		if collection.access == AccessMode::AllowList {
-			collection.check_allowlist(&sender)?;
+			collection.check_allowlist(sender)?;
 			if let Some(spender) = spender {
-				collection.check_allowlist(&spender)?;
+				collection.check_allowlist(spender)?;
 			}
 		}
 
@@ -491,7 +491,7 @@
 
 		// =========
 
-		Self::transfer(collection, &from, to, token)?;
+		Self::transfer(collection, from, to, token)?;
 		// Allowance is reset in [`transfer`]
 		Ok(())
 	}
@@ -519,7 +519,7 @@
 
 		// =========
 
-		Self::burn(collection, &from, token)
+		Self::burn(collection, from, token)
 	}
 
 	pub fn set_variable_metadata(
modifiedpallets/nonfungible/src/weights.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/weights.rs
+++ b/pallets/nonfungible/src/weights.rs
@@ -25,6 +25,7 @@
 #![cfg_attr(rustfmt, rustfmt_skip)]
 #![allow(unused_parens)]
 #![allow(unused_imports)]
+#![allow(clippy::unnecessary_cast)]
 
 use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
 use sp_std::marker::PhantomData;
@@ -33,11 +34,11 @@
 pub trait WeightInfo {
 	fn create_item() -> Weight;
 	fn create_multiple_items(b: u32, ) -> Weight;
-	fn burn_from() -> Weight;
 	fn burn_item() -> Weight;
 	fn transfer() -> Weight;
 	fn approve() -> Weight;
 	fn transfer_from() -> Weight;
+	fn burn_from() -> Weight;
 	fn set_variable_metadata(b: u32, ) -> Weight;
 }
 
modifiedpallets/refungible/src/common.rsdiffbeforeafterboth
--- a/pallets/refungible/src/common.rs
+++ b/pallets/refungible/src/common.rs
@@ -135,7 +135,7 @@
 		amount: u128,
 	) -> DispatchResultWithPostInfo {
 		with_weight(
-			<Pallet<T>>::transfer(&self, &from, &to, token, amount),
+			<Pallet<T>>::transfer(self, &from, &to, token, amount),
 			<CommonWeights<T>>::transfer(),
 		)
 	}
@@ -148,7 +148,7 @@
 		amount: u128,
 	) -> DispatchResultWithPostInfo {
 		with_weight(
-			<Pallet<T>>::set_allowance(&self, &sender, &spender, token, amount),
+			<Pallet<T>>::set_allowance(self, &sender, &spender, token, amount),
 			<CommonWeights<T>>::approve(),
 		)
 	}
@@ -162,7 +162,7 @@
 		amount: u128,
 	) -> DispatchResultWithPostInfo {
 		with_weight(
-			<Pallet<T>>::transfer_from(&self, &sender, &from, &to, token, amount),
+			<Pallet<T>>::transfer_from(self, &sender, &from, &to, token, amount),
 			<CommonWeights<T>>::transfer_from(),
 		)
 	}
@@ -175,7 +175,7 @@
 		amount: u128,
 	) -> DispatchResultWithPostInfo {
 		with_weight(
-			<Pallet<T>>::burn_from(&self, &sender, &from, token, amount),
+			<Pallet<T>>::burn_from(self, &sender, &from, token, amount),
 			<CommonWeights<T>>::burn_from(),
 		)
 	}
@@ -188,7 +188,7 @@
 	) -> DispatchResultWithPostInfo {
 		let len = data.len();
 		with_weight(
-			<Pallet<T>>::set_variable_metadata(&self, &sender, token, data),
+			<Pallet<T>>::set_variable_metadata(self, &sender, token, data),
 			<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
@@ -189,7 +189,7 @@
 		<Balance<T>>::remove_prefix((collection.id, token_id), None);
 		<Allowance<T>>::remove_prefix((collection.id, token_id), None);
 		// TODO: ERC721 transfer event
-		return Ok(());
+		Ok(())
 	}
 
 	pub fn burn(
@@ -367,8 +367,8 @@
 			collection.check_allowlist(sender)?;
 
 			for item in data.iter() {
-				for (user, _) in &item.users {
-					collection.check_allowlist(&user)?;
+				for user in item.users.keys() {
+					collection.check_allowlist(user)?;
 				}
 			}
 		}
@@ -409,7 +409,7 @@
 
 		let mut balances = BTreeMap::new();
 		for data in &data {
-			for (owner, _) in &data.users {
+			for owner in data.users.keys() {
 				let balance = balances
 					.entry(owner)
 					.or_insert_with(|| <AccountBalance<T>>::get((collection.id, owner)));
@@ -483,8 +483,8 @@
 		amount: u128,
 	) -> DispatchResult {
 		if collection.access == AccessMode::AllowList {
-			collection.check_allowlist(&sender)?;
-			collection.check_allowlist(&spender)?;
+			collection.check_allowlist(sender)?;
+			collection.check_allowlist(spender)?;
 		}
 
 		<PalletCommon<T>>::ensure_correct_receiver(spender)?;
modifiedpallets/refungible/src/weights.rsdiffbeforeafterboth
before · 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_from() -> Weight;37	fn burn_item_partial() -> Weight;38	fn burn_item_fully() -> Weight;39	fn transfer_normal() -> Weight;40	fn transfer_creating() -> Weight;41	fn transfer_removing() -> Weight;42	fn transfer_creating_removing() -> Weight;43	fn approve() -> Weight;44	fn transfer_from_normal() -> Weight;45	fn transfer_from_creating() -> Weight;46	fn transfer_from_removing() -> Weight;47	fn transfer_from_creating_removing() -> Weight;48	fn set_variable_metadata(b: u32, ) -> Weight;49}5051/// Weights for pallet_refungible using the Substrate node and recommended hardware.52pub struct SubstrateWeight<T>(PhantomData<T>);53impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {54	// Storage: Refungible TokensMinted (r:1 w:1)55	// Storage: Refungible AccountBalance (r:1 w:1)56	// Storage: Refungible Balance (r:0 w:1)57	// Storage: Refungible TotalSupply (r:0 w:1)58	// Storage: Refungible TokenData (r:0 w:1)59	// Storage: Refungible Owned (r:0 w:1)60	fn create_item() -> Weight {61		(18_681_000 as Weight)62			.saturating_add(T::DbWeight::get().reads(2 as Weight))63			.saturating_add(T::DbWeight::get().writes(6 as Weight))64	}65	// Storage: Refungible TokensMinted (r:1 w:1)66	// Storage: Refungible AccountBalance (r:1 w:1)67	// Storage: Refungible Balance (r:0 w:4)68	// Storage: Refungible TotalSupply (r:0 w:4)69	// Storage: Refungible TokenData (r:0 w:4)70	// Storage: Refungible Owned (r:0 w:4)71	fn create_multiple_items(b: u32, ) -> Weight {72		(13_869_000 as Weight)73			// Standard Error: 28_00074			.saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))75			.saturating_add(T::DbWeight::get().reads(2 as Weight))76			.saturating_add(T::DbWeight::get().writes(2 as Weight))77			.saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))78	}79	// Storage: Refungible TotalSupply (r:1 w:1)80	// Storage: Refungible Balance (r:1 w:1)81	// Storage: Refungible AccountBalance (r:1 w:1)82	// Storage: Refungible Owned (r:0 w:1)83	fn burn_item_partial() -> Weight {84		(21_591_000 as Weight)85			.saturating_add(T::DbWeight::get().reads(3 as Weight))86			.saturating_add(T::DbWeight::get().writes(4 as Weight))87	}88	// Storage: Refungible TotalSupply (r:1 w:1)89	// Storage: Refungible Balance (r:1 w:1)90	// Storage: Refungible AccountBalance (r:1 w:1)91	// Storage: Refungible TokensBurnt (r:1 w:1)92	// Storage: Refungible TokenData (r:0 w:1)93	// Storage: Refungible Owned (r:0 w:1)94	fn burn_item_fully() -> Weight {95		(29_257_000 as Weight)96			.saturating_add(T::DbWeight::get().reads(4 as Weight))97			.saturating_add(T::DbWeight::get().writes(6 as Weight))98	}99	// Storage: Refungible Balance (r:2 w:2)100	fn transfer_normal() -> Weight {101		(17_733_000 as Weight)102			.saturating_add(T::DbWeight::get().reads(2 as Weight))103			.saturating_add(T::DbWeight::get().writes(2 as Weight))104	}105	// Storage: Refungible Balance (r:2 w:2)106	// Storage: Refungible AccountBalance (r:1 w:1)107	// Storage: Refungible Owned (r:0 w:1)108	fn transfer_creating() -> Weight {109		(20_943_000 as Weight)110			.saturating_add(T::DbWeight::get().reads(3 as Weight))111			.saturating_add(T::DbWeight::get().writes(4 as Weight))112	}113	// Storage: Refungible Balance (r:2 w:2)114	// Storage: Refungible AccountBalance (r:1 w:1)115	// Storage: Refungible Owned (r:0 w:1)116	fn transfer_removing() -> Weight {117		(22_406_000 as Weight)118			.saturating_add(T::DbWeight::get().reads(3 as Weight))119			.saturating_add(T::DbWeight::get().writes(4 as Weight))120	}121	// Storage: Refungible Balance (r:2 w:2)122	// Storage: Refungible AccountBalance (r:2 w:2)123	// Storage: Refungible Owned (r:0 w:2)124	fn transfer_creating_removing() -> Weight {125		(24_762_000 as Weight)126			.saturating_add(T::DbWeight::get().reads(4 as Weight))127			.saturating_add(T::DbWeight::get().writes(6 as Weight))128	}129	// Storage: Refungible Balance (r:1 w:0)130	// Storage: Refungible Allowance (r:0 w:1)131	fn approve() -> Weight {132		(14_109_000 as Weight)133			.saturating_add(T::DbWeight::get().reads(1 as Weight))134			.saturating_add(T::DbWeight::get().writes(1 as Weight))135	}136	// Storage: Refungible Allowance (r:1 w:1)137	// Storage: Refungible Balance (r:2 w:2)138	fn transfer_from_normal() -> Weight {139		(25_348_000 as Weight)140			.saturating_add(T::DbWeight::get().reads(3 as Weight))141			.saturating_add(T::DbWeight::get().writes(3 as Weight))142	}143	// Storage: Refungible Allowance (r:1 w:1)144	// Storage: Refungible Balance (r:2 w:2)145	// Storage: Refungible AccountBalance (r:1 w:1)146	// Storage: Refungible Owned (r:0 w:1)147	fn transfer_from_creating() -> Weight {148		(28_647_000 as Weight)149			.saturating_add(T::DbWeight::get().reads(4 as Weight))150			.saturating_add(T::DbWeight::get().writes(5 as Weight))151	}152	// Storage: Refungible Allowance (r:1 w:1)153	// Storage: Refungible Balance (r:2 w:2)154	// Storage: Refungible AccountBalance (r:1 w:1)155	// Storage: Refungible Owned (r:0 w:1)156	fn transfer_from_removing() -> Weight {157		(30_472_000 as Weight)158			.saturating_add(T::DbWeight::get().reads(4 as Weight))159			.saturating_add(T::DbWeight::get().writes(5 as Weight))160	}161	// Storage: Refungible Allowance (r:1 w:1)162	// Storage: Refungible Balance (r:2 w:2)163	// Storage: Refungible AccountBalance (r:2 w:2)164	// Storage: Refungible Owned (r:0 w:2)165	fn transfer_from_creating_removing() -> Weight {166		(32_362_000 as Weight)167			.saturating_add(T::DbWeight::get().reads(5 as Weight))168			.saturating_add(T::DbWeight::get().writes(7 as Weight))169	}170	// Storage: Refungible Allowance (r:1 w:1)171	// Storage: Refungible TotalSupply (r:1 w:1)172	// Storage: Refungible Balance (r:1 w:1)173	// Storage: Refungible AccountBalance (r:1 w:1)174	// Storage: Refungible TokensBurnt (r:1 w:1)175	// Storage: Refungible TokenData (r:0 w:1)176	// Storage: Refungible Owned (r:0 w:1)177	fn burn_from() -> Weight {178		(60_903_000 as Weight)179			.saturating_add(T::DbWeight::get().reads(5 as Weight))180			.saturating_add(T::DbWeight::get().writes(7 as Weight))181	}182	// Storage: Refungible TokenData (r:1 w:1)183	fn set_variable_metadata(_b: u32, ) -> Weight {184		(6_801_000 as Weight)185			.saturating_add(T::DbWeight::get().reads(1 as Weight))186			.saturating_add(T::DbWeight::get().writes(1 as Weight))187	}188}189190// For backwards compatibility and tests191impl WeightInfo for () {192	// Storage: Refungible TokensMinted (r:1 w:1)193	// Storage: Refungible AccountBalance (r:1 w:1)194	// Storage: Refungible Balance (r:0 w:1)195	// Storage: Refungible TotalSupply (r:0 w:1)196	// Storage: Refungible TokenData (r:0 w:1)197	// Storage: Refungible Owned (r:0 w:1)198	fn create_item() -> Weight {199		(18_681_000 as Weight)200			.saturating_add(RocksDbWeight::get().reads(2 as Weight))201			.saturating_add(RocksDbWeight::get().writes(6 as Weight))202	}203	// Storage: Refungible TokensMinted (r:1 w:1)204	// Storage: Refungible AccountBalance (r:1 w:1)205	// Storage: Refungible Balance (r:0 w:4)206	// Storage: Refungible TotalSupply (r:0 w:4)207	// Storage: Refungible TokenData (r:0 w:4)208	// Storage: Refungible Owned (r:0 w:4)209	fn create_multiple_items(b: u32, ) -> Weight {210		(13_869_000 as Weight)211			// Standard Error: 28_000212			.saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))213			.saturating_add(RocksDbWeight::get().reads(2 as Weight))214			.saturating_add(RocksDbWeight::get().writes(2 as Weight))215			.saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))216	}217	// Storage: Refungible TotalSupply (r:1 w:1)218	// Storage: Refungible Balance (r:1 w:1)219	// Storage: Refungible AccountBalance (r:1 w:1)220	// Storage: Refungible Owned (r:0 w:1)221	fn burn_item_partial() -> Weight {222		(21_591_000 as Weight)223			.saturating_add(RocksDbWeight::get().reads(3 as Weight))224			.saturating_add(RocksDbWeight::get().writes(4 as Weight))225	}226	// Storage: Refungible TotalSupply (r:1 w:1)227	// Storage: Refungible Balance (r:1 w:1)228	// Storage: Refungible AccountBalance (r:1 w:1)229	// Storage: Refungible TokensBurnt (r:1 w:1)230	// Storage: Refungible TokenData (r:0 w:1)231	// Storage: Refungible Owned (r:0 w:1)232	fn burn_item_fully() -> Weight {233		(29_257_000 as Weight)234			.saturating_add(RocksDbWeight::get().reads(4 as Weight))235			.saturating_add(RocksDbWeight::get().writes(6 as Weight))236	}237	// Storage: Refungible Balance (r:2 w:2)238	fn transfer_normal() -> Weight {239		(17_733_000 as Weight)240			.saturating_add(RocksDbWeight::get().reads(2 as Weight))241			.saturating_add(RocksDbWeight::get().writes(2 as Weight))242	}243	// Storage: Refungible Balance (r:2 w:2)244	// Storage: Refungible AccountBalance (r:1 w:1)245	// Storage: Refungible Owned (r:0 w:1)246	fn transfer_creating() -> Weight {247		(20_943_000 as Weight)248			.saturating_add(RocksDbWeight::get().reads(3 as Weight))249			.saturating_add(RocksDbWeight::get().writes(4 as Weight))250	}251	// Storage: Refungible Balance (r:2 w:2)252	// Storage: Refungible AccountBalance (r:1 w:1)253	// Storage: Refungible Owned (r:0 w:1)254	fn transfer_removing() -> Weight {255		(22_406_000 as Weight)256			.saturating_add(RocksDbWeight::get().reads(3 as Weight))257			.saturating_add(RocksDbWeight::get().writes(4 as Weight))258	}259	// Storage: Refungible Balance (r:2 w:2)260	// Storage: Refungible AccountBalance (r:2 w:2)261	// Storage: Refungible Owned (r:0 w:2)262	fn transfer_creating_removing() -> Weight {263		(24_762_000 as Weight)264			.saturating_add(RocksDbWeight::get().reads(4 as Weight))265			.saturating_add(RocksDbWeight::get().writes(6 as Weight))266	}267	// Storage: Refungible Balance (r:1 w:0)268	// Storage: Refungible Allowance (r:0 w:1)269	fn approve() -> Weight {270		(14_109_000 as Weight)271			.saturating_add(RocksDbWeight::get().reads(1 as Weight))272			.saturating_add(RocksDbWeight::get().writes(1 as Weight))273	}274	// Storage: Refungible Allowance (r:1 w:1)275	// Storage: Refungible Balance (r:2 w:2)276	fn transfer_from_normal() -> Weight {277		(25_348_000 as Weight)278			.saturating_add(RocksDbWeight::get().reads(3 as Weight))279			.saturating_add(RocksDbWeight::get().writes(3 as Weight))280	}281	// Storage: Refungible Allowance (r:1 w:1)282	// Storage: Refungible Balance (r:2 w:2)283	// Storage: Refungible AccountBalance (r:1 w:1)284	// Storage: Refungible Owned (r:0 w:1)285	fn transfer_from_creating() -> Weight {286		(28_647_000 as Weight)287			.saturating_add(RocksDbWeight::get().reads(4 as Weight))288			.saturating_add(RocksDbWeight::get().writes(5 as Weight))289	}290	// Storage: Refungible Allowance (r:1 w:1)291	// Storage: Refungible Balance (r:2 w:2)292	// Storage: Refungible AccountBalance (r:1 w:1)293	// Storage: Refungible Owned (r:0 w:1)294	fn transfer_from_removing() -> Weight {295		(30_472_000 as Weight)296			.saturating_add(RocksDbWeight::get().reads(4 as Weight))297			.saturating_add(RocksDbWeight::get().writes(5 as Weight))298	}299	// Storage: Refungible Allowance (r:1 w:1)300	// Storage: Refungible Balance (r:2 w:2)301	// Storage: Refungible AccountBalance (r:2 w:2)302	// Storage: Refungible Owned (r:0 w:2)303	fn transfer_from_creating_removing() -> Weight {304		(32_362_000 as Weight)305			.saturating_add(RocksDbWeight::get().reads(5 as Weight))306			.saturating_add(RocksDbWeight::get().writes(7 as Weight))307	}308	// Storage: Refungible Allowance (r:1 w:1)309	// Storage: Refungible TotalSupply (r:1 w:1)310	// Storage: Refungible Balance (r:1 w:1)311	// Storage: Refungible AccountBalance (r:1 w:1)312	// Storage: Refungible TokensBurnt (r:1 w:1)313	// Storage: Refungible TokenData (r:0 w:1)314	// Storage: Refungible Owned (r:0 w:1)315	fn burn_from() -> Weight {316		(60_903_000 as Weight)317			.saturating_add(RocksDbWeight::get().reads(5 as Weight))318			.saturating_add(RocksDbWeight::get().writes(7 as Weight))319	}320	// Storage: Refungible TokenData (r:1 w:1)321	fn set_variable_metadata(_b: u32, ) -> Weight {322		(6_801_000 as Weight)323			.saturating_add(RocksDbWeight::get().reads(1 as Weight))324			.saturating_add(RocksDbWeight::get().writes(1 as Weight))325	}326}
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)]28#![allow(clippy::unnecessary_cast)]2930use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};31use sp_std::marker::PhantomData;3233/// Weight functions needed for pallet_refungible.34pub trait WeightInfo {35	fn create_item() -> Weight;36	fn create_multiple_items(b: u32, ) -> Weight;37	fn burn_item_partial() -> Weight;38	fn burn_item_fully() -> Weight;39	fn transfer_normal() -> Weight;40	fn transfer_creating() -> Weight;41	fn transfer_removing() -> Weight;42	fn transfer_creating_removing() -> Weight;43	fn approve() -> Weight;44	fn transfer_from_normal() -> Weight;45	fn transfer_from_creating() -> Weight;46	fn transfer_from_removing() -> Weight;47	fn transfer_from_creating_removing() -> Weight;48	fn burn_from() -> Weight;49	fn set_variable_metadata(b: u32, ) -> Weight;50}5152/// Weights for pallet_refungible using the Substrate node and recommended hardware.53pub struct SubstrateWeight<T>(PhantomData<T>);54impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {55	// Storage: Refungible TokensMinted (r:1 w:1)56	// Storage: Refungible AccountBalance (r:1 w:1)57	// Storage: Refungible Balance (r:0 w:1)58	// Storage: Refungible TotalSupply (r:0 w:1)59	// Storage: Refungible TokenData (r:0 w:1)60	// Storage: Refungible Owned (r:0 w:1)61	fn create_item() -> Weight {62		(18_681_000 as Weight)63			.saturating_add(T::DbWeight::get().reads(2 as Weight))64			.saturating_add(T::DbWeight::get().writes(6 as Weight))65	}66	// Storage: Refungible TokensMinted (r:1 w:1)67	// Storage: Refungible AccountBalance (r:1 w:1)68	// Storage: Refungible Balance (r:0 w:4)69	// Storage: Refungible TotalSupply (r:0 w:4)70	// Storage: Refungible TokenData (r:0 w:4)71	// Storage: Refungible Owned (r:0 w:4)72	fn create_multiple_items(b: u32, ) -> Weight {73		(13_869_000 as Weight)74			// Standard Error: 28_00075			.saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))76			.saturating_add(T::DbWeight::get().reads(2 as Weight))77			.saturating_add(T::DbWeight::get().writes(2 as Weight))78			.saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))79	}80	// Storage: Refungible TotalSupply (r:1 w:1)81	// Storage: Refungible Balance (r:1 w:1)82	// Storage: Refungible AccountBalance (r:1 w:1)83	// Storage: Refungible Owned (r:0 w:1)84	fn burn_item_partial() -> Weight {85		(21_591_000 as Weight)86			.saturating_add(T::DbWeight::get().reads(3 as Weight))87			.saturating_add(T::DbWeight::get().writes(4 as Weight))88	}89	// Storage: Refungible TotalSupply (r:1 w:1)90	// Storage: Refungible Balance (r:1 w:1)91	// Storage: Refungible AccountBalance (r:1 w:1)92	// Storage: Refungible TokensBurnt (r:1 w:1)93	// Storage: Refungible TokenData (r:0 w:1)94	// Storage: Refungible Owned (r:0 w:1)95	fn burn_item_fully() -> Weight {96		(29_257_000 as Weight)97			.saturating_add(T::DbWeight::get().reads(4 as Weight))98			.saturating_add(T::DbWeight::get().writes(6 as Weight))99	}100	// Storage: Refungible Balance (r:2 w:2)101	fn transfer_normal() -> Weight {102		(17_733_000 as Weight)103			.saturating_add(T::DbWeight::get().reads(2 as Weight))104			.saturating_add(T::DbWeight::get().writes(2 as Weight))105	}106	// Storage: Refungible Balance (r:2 w:2)107	// Storage: Refungible AccountBalance (r:1 w:1)108	// Storage: Refungible Owned (r:0 w:1)109	fn transfer_creating() -> Weight {110		(20_943_000 as Weight)111			.saturating_add(T::DbWeight::get().reads(3 as Weight))112			.saturating_add(T::DbWeight::get().writes(4 as Weight))113	}114	// Storage: Refungible Balance (r:2 w:2)115	// Storage: Refungible AccountBalance (r:1 w:1)116	// Storage: Refungible Owned (r:0 w:1)117	fn transfer_removing() -> Weight {118		(22_406_000 as Weight)119			.saturating_add(T::DbWeight::get().reads(3 as Weight))120			.saturating_add(T::DbWeight::get().writes(4 as Weight))121	}122	// Storage: Refungible Balance (r:2 w:2)123	// Storage: Refungible AccountBalance (r:2 w:2)124	// Storage: Refungible Owned (r:0 w:2)125	fn transfer_creating_removing() -> Weight {126		(24_762_000 as Weight)127			.saturating_add(T::DbWeight::get().reads(4 as Weight))128			.saturating_add(T::DbWeight::get().writes(6 as Weight))129	}130	// Storage: Refungible Balance (r:1 w:0)131	// Storage: Refungible Allowance (r:0 w:1)132	fn approve() -> Weight {133		(14_109_000 as Weight)134			.saturating_add(T::DbWeight::get().reads(1 as Weight))135			.saturating_add(T::DbWeight::get().writes(1 as Weight))136	}137	// Storage: Refungible Allowance (r:1 w:1)138	// Storage: Refungible Balance (r:2 w:2)139	fn transfer_from_normal() -> Weight {140		(25_348_000 as Weight)141			.saturating_add(T::DbWeight::get().reads(3 as Weight))142			.saturating_add(T::DbWeight::get().writes(3 as Weight))143	}144	// Storage: Refungible Allowance (r:1 w:1)145	// Storage: Refungible Balance (r:2 w:2)146	// Storage: Refungible AccountBalance (r:1 w:1)147	// Storage: Refungible Owned (r:0 w:1)148	fn transfer_from_creating() -> Weight {149		(28_647_000 as Weight)150			.saturating_add(T::DbWeight::get().reads(4 as Weight))151			.saturating_add(T::DbWeight::get().writes(5 as Weight))152	}153	// Storage: Refungible Allowance (r:1 w:1)154	// Storage: Refungible Balance (r:2 w:2)155	// Storage: Refungible AccountBalance (r:1 w:1)156	// Storage: Refungible Owned (r:0 w:1)157	fn transfer_from_removing() -> Weight {158		(30_472_000 as Weight)159			.saturating_add(T::DbWeight::get().reads(4 as Weight))160			.saturating_add(T::DbWeight::get().writes(5 as Weight))161	}162	// Storage: Refungible Allowance (r:1 w:1)163	// Storage: Refungible Balance (r:2 w:2)164	// Storage: Refungible AccountBalance (r:2 w:2)165	// Storage: Refungible Owned (r:0 w:2)166	fn transfer_from_creating_removing() -> Weight {167		(32_362_000 as Weight)168			.saturating_add(T::DbWeight::get().reads(5 as Weight))169			.saturating_add(T::DbWeight::get().writes(7 as Weight))170	}171	// Storage: Refungible Allowance (r:1 w:1)172	// Storage: Refungible TotalSupply (r:1 w:1)173	// Storage: Refungible Balance (r:1 w:1)174	// Storage: Refungible AccountBalance (r:1 w:1)175	// Storage: Refungible TokensBurnt (r:1 w:1)176	// Storage: Refungible TokenData (r:0 w:1)177	// Storage: Refungible Owned (r:0 w:1)178	fn burn_from() -> Weight {179		(60_903_000 as Weight)180			.saturating_add(T::DbWeight::get().reads(5 as Weight))181			.saturating_add(T::DbWeight::get().writes(7 as Weight))182	}183	// Storage: Refungible TokenData (r:1 w:1)184	fn set_variable_metadata(_b: u32, ) -> Weight {185		(6_801_000 as Weight)186			.saturating_add(T::DbWeight::get().reads(1 as Weight))187			.saturating_add(T::DbWeight::get().writes(1 as Weight))188	}189}190191// For backwards compatibility and tests192impl WeightInfo for () {193	// Storage: Refungible TokensMinted (r:1 w:1)194	// Storage: Refungible AccountBalance (r:1 w:1)195	// Storage: Refungible Balance (r:0 w:1)196	// Storage: Refungible TotalSupply (r:0 w:1)197	// Storage: Refungible TokenData (r:0 w:1)198	// Storage: Refungible Owned (r:0 w:1)199	fn create_item() -> Weight {200		(18_681_000 as Weight)201			.saturating_add(RocksDbWeight::get().reads(2 as Weight))202			.saturating_add(RocksDbWeight::get().writes(6 as Weight))203	}204	// Storage: Refungible TokensMinted (r:1 w:1)205	// Storage: Refungible AccountBalance (r:1 w:1)206	// Storage: Refungible Balance (r:0 w:4)207	// Storage: Refungible TotalSupply (r:0 w:4)208	// Storage: Refungible TokenData (r:0 w:4)209	// Storage: Refungible Owned (r:0 w:4)210	fn create_multiple_items(b: u32, ) -> Weight {211		(13_869_000 as Weight)212			// Standard Error: 28_000213			.saturating_add((5_611_000 as Weight).saturating_mul(b as Weight))214			.saturating_add(RocksDbWeight::get().reads(2 as Weight))215			.saturating_add(RocksDbWeight::get().writes(2 as Weight))216			.saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(b as Weight)))217	}218	// Storage: Refungible TotalSupply (r:1 w:1)219	// Storage: Refungible Balance (r:1 w:1)220	// Storage: Refungible AccountBalance (r:1 w:1)221	// Storage: Refungible Owned (r:0 w:1)222	fn burn_item_partial() -> Weight {223		(21_591_000 as Weight)224			.saturating_add(RocksDbWeight::get().reads(3 as Weight))225			.saturating_add(RocksDbWeight::get().writes(4 as Weight))226	}227	// Storage: Refungible TotalSupply (r:1 w:1)228	// Storage: Refungible Balance (r:1 w:1)229	// Storage: Refungible AccountBalance (r:1 w:1)230	// Storage: Refungible TokensBurnt (r:1 w:1)231	// Storage: Refungible TokenData (r:0 w:1)232	// Storage: Refungible Owned (r:0 w:1)233	fn burn_item_fully() -> Weight {234		(29_257_000 as Weight)235			.saturating_add(RocksDbWeight::get().reads(4 as Weight))236			.saturating_add(RocksDbWeight::get().writes(6 as Weight))237	}238	// Storage: Refungible Balance (r:2 w:2)239	fn transfer_normal() -> Weight {240		(17_733_000 as Weight)241			.saturating_add(RocksDbWeight::get().reads(2 as Weight))242			.saturating_add(RocksDbWeight::get().writes(2 as Weight))243	}244	// Storage: Refungible Balance (r:2 w:2)245	// Storage: Refungible AccountBalance (r:1 w:1)246	// Storage: Refungible Owned (r:0 w:1)247	fn transfer_creating() -> Weight {248		(20_943_000 as Weight)249			.saturating_add(RocksDbWeight::get().reads(3 as Weight))250			.saturating_add(RocksDbWeight::get().writes(4 as Weight))251	}252	// Storage: Refungible Balance (r:2 w:2)253	// Storage: Refungible AccountBalance (r:1 w:1)254	// Storage: Refungible Owned (r:0 w:1)255	fn transfer_removing() -> Weight {256		(22_406_000 as Weight)257			.saturating_add(RocksDbWeight::get().reads(3 as Weight))258			.saturating_add(RocksDbWeight::get().writes(4 as Weight))259	}260	// Storage: Refungible Balance (r:2 w:2)261	// Storage: Refungible AccountBalance (r:2 w:2)262	// Storage: Refungible Owned (r:0 w:2)263	fn transfer_creating_removing() -> Weight {264		(24_762_000 as Weight)265			.saturating_add(RocksDbWeight::get().reads(4 as Weight))266			.saturating_add(RocksDbWeight::get().writes(6 as Weight))267	}268	// Storage: Refungible Balance (r:1 w:0)269	// Storage: Refungible Allowance (r:0 w:1)270	fn approve() -> Weight {271		(14_109_000 as Weight)272			.saturating_add(RocksDbWeight::get().reads(1 as Weight))273			.saturating_add(RocksDbWeight::get().writes(1 as Weight))274	}275	// Storage: Refungible Allowance (r:1 w:1)276	// Storage: Refungible Balance (r:2 w:2)277	fn transfer_from_normal() -> Weight {278		(25_348_000 as Weight)279			.saturating_add(RocksDbWeight::get().reads(3 as Weight))280			.saturating_add(RocksDbWeight::get().writes(3 as Weight))281	}282	// Storage: Refungible Allowance (r:1 w:1)283	// Storage: Refungible Balance (r:2 w:2)284	// Storage: Refungible AccountBalance (r:1 w:1)285	// Storage: Refungible Owned (r:0 w:1)286	fn transfer_from_creating() -> Weight {287		(28_647_000 as Weight)288			.saturating_add(RocksDbWeight::get().reads(4 as Weight))289			.saturating_add(RocksDbWeight::get().writes(5 as Weight))290	}291	// Storage: Refungible Allowance (r:1 w:1)292	// Storage: Refungible Balance (r:2 w:2)293	// Storage: Refungible AccountBalance (r:1 w:1)294	// Storage: Refungible Owned (r:0 w:1)295	fn transfer_from_removing() -> Weight {296		(30_472_000 as Weight)297			.saturating_add(RocksDbWeight::get().reads(4 as Weight))298			.saturating_add(RocksDbWeight::get().writes(5 as Weight))299	}300	// Storage: Refungible Allowance (r:1 w:1)301	// Storage: Refungible Balance (r:2 w:2)302	// Storage: Refungible AccountBalance (r:2 w:2)303	// Storage: Refungible Owned (r:0 w:2)304	fn transfer_from_creating_removing() -> Weight {305		(32_362_000 as Weight)306			.saturating_add(RocksDbWeight::get().reads(5 as Weight))307			.saturating_add(RocksDbWeight::get().writes(7 as Weight))308	}309	// Storage: Refungible Allowance (r:1 w:1)310	// Storage: Refungible TotalSupply (r:1 w:1)311	// Storage: Refungible Balance (r:1 w:1)312	// Storage: Refungible AccountBalance (r:1 w:1)313	// Storage: Refungible TokensBurnt (r:1 w:1)314	// Storage: Refungible TokenData (r:0 w:1)315	// Storage: Refungible Owned (r:0 w:1)316	fn burn_from() -> Weight {317		(60_903_000 as Weight)318			.saturating_add(RocksDbWeight::get().reads(5 as Weight))319			.saturating_add(RocksDbWeight::get().writes(7 as Weight))320	}321	// Storage: Refungible TokenData (r:1 w:1)322	fn set_variable_metadata(_b: u32, ) -> Weight {323		(6_801_000 as Weight)324			.saturating_add(RocksDbWeight::get().reads(1 as Weight))325			.saturating_add(RocksDbWeight::get().writes(1 as Weight))326	}327}
modifiedprimitives/nft/src/lib.rsdiffbeforeafterboth
--- a/primitives/nft/src/lib.rs
+++ b/primitives/nft/src/lib.rs
@@ -327,8 +327,7 @@
 		D: ser::Serializer,
 		V: Serialize,
 	{
-		let vec: &Vec<_> = &value;
-		vec.serialize(serializer)
+		(value as &Vec<_>).serialize(serializer)
 	}
 
 	pub fn deserialize<'de, D, V, S>(deserializer: D) -> Result<BoundedVec<V, S>, D::Error>
modifiedruntime/src/lib.rsdiffbeforeafterboth
--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -1177,6 +1177,7 @@
 			EVM::account_storages(address, H256::from_slice(&tmp[..]))
 		}
 
+		#[allow(clippy::redundant_closure)]
 		fn call(
 			from: H160,
 			to: H160,
@@ -1207,6 +1208,7 @@
 			).map_err(|err| err.into())
 		}
 
+		#[allow(clippy::redundant_closure)]
 		fn create(
 			from: H160,
 			data: Vec<u8>,