git.delta.rocks / unique-network / refs/commits / 0f77c1087f67

difftreelog

fix benchmarks

Daniel Shiposha2023-11-27parent: #c01d30b.patch.diff
in: master

5 files changed

modifiedpallets/common/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/common/src/benchmarking.rs
+++ b/pallets/common/src/benchmarking.rs
@@ -33,7 +33,7 @@
 	MAX_COLLECTION_NAME_LENGTH, MAX_PROPERTIES_PER_ITEM, MAX_TOKEN_PREFIX_LENGTH,
 };
 
-use crate::{BenchmarkPropertyWriter, CollectionHandle, Config, Pallet};
+use crate::{BenchmarkPropertyWriter, CollectionHandle, CollectionIssuer, Config, Pallet};
 
 const SEED: u32 = 1;
 
@@ -121,7 +121,7 @@
 		owner,
 		CollectionMode::NFT,
 		|owner: T::CrossAccountId, data| {
-			<Pallet<T>>::init_collection(owner.clone(), Some(owner), false, data)
+			<Pallet<T>>::init_collection(owner.clone(), CollectionIssuer::User(owner), data)
 		},
 		|h| h,
 	)
modifiedpallets/fungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/fungible/src/benchmarking.rs
+++ b/pallets/fungible/src/benchmarking.rs
@@ -15,7 +15,9 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 use frame_benchmarking::{account, v2::*};
-use pallet_common::{bench_init, benchmarking::create_collection_raw, Pallet as PalletCommon};
+use pallet_common::{
+	bench_init, benchmarking::create_collection_raw, CollectionIssuer, Pallet as PalletCommon,
+};
 use sp_std::prelude::*;
 use up_data_structs::{budget::Unlimited, CollectionMode, MAX_ITEMS_PER_BATCH};
 
@@ -31,7 +33,7 @@
 		owner,
 		CollectionMode::Fungible(0),
 		|owner: T::CrossAccountId, data| {
-			<PalletCommon<T>>::init_collection(owner.clone(), Some(owner), false, data)
+			<PalletCommon<T>>::init_collection(owner.clone(), CollectionIssuer::User(owner), data)
 		},
 		FungibleHandle::cast,
 	)
modifiedpallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/benchmarking.rs
+++ b/pallets/nonfungible/src/benchmarking.rs
@@ -18,7 +18,7 @@
 use pallet_common::{
 	bench_init,
 	benchmarking::{create_collection_raw, property_key, property_value},
-	Pallet as PalletCommon,
+	CollectionIssuer, Pallet as PalletCommon,
 };
 use sp_std::prelude::*;
 use up_data_structs::{
@@ -58,7 +58,7 @@
 		owner,
 		CollectionMode::NFT,
 		|owner: T::CrossAccountId, data| {
-			<PalletCommon<T>>::init_collection(owner.clone(), Some(owner), false, data)
+			<PalletCommon<T>>::init_collection(owner.clone(), CollectionIssuer::User(owner), data)
 		},
 		NonfungibleHandle::cast,
 	)
modifiedpallets/refungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/refungible/src/benchmarking.rs
+++ b/pallets/refungible/src/benchmarking.rs
@@ -20,7 +20,7 @@
 use pallet_common::{
 	bench_init,
 	benchmarking::{create_collection_raw, property_key, property_value},
-	Pallet as PalletCommon,
+	CollectionIssuer, Pallet as PalletCommon,
 };
 use sp_std::prelude::*;
 use up_data_structs::{
@@ -63,7 +63,7 @@
 		owner,
 		CollectionMode::ReFungible,
 		|owner: T::CrossAccountId, data| {
-			<PalletCommon<T>>::init_collection(owner.clone(), Some(owner), false, data)
+			<PalletCommon<T>>::init_collection(owner.clone(), CollectionIssuer::User(owner), data)
 		},
 		RefungibleHandle::cast,
 	)
modifiedpallets/structure/src/benchmarking.rsdiffbeforeafterboth
1616
17use frame_benchmarking::v2::{account, benchmarks, BenchmarkError};17use frame_benchmarking::v2::{account, benchmarks, BenchmarkError};
18use frame_support::traits::{fungible::Balanced, tokens::Precision, Get};18use frame_support::traits::{fungible::Balanced, tokens::Precision, Get};
19use pallet_common::Config as CommonConfig;19use pallet_common::{CollectionIssuer, Config as CommonConfig};
20use pallet_evm::account::CrossAccountId;20use pallet_evm::account::CrossAccountId;
21use sp_std::vec;21use sp_std::vec;
22use up_data_structs::{22use up_data_structs::{
44 .unwrap();44 .unwrap();
45 T::CollectionDispatch::create(45 T::CollectionDispatch::create(
46 caller_cross.clone(),46 caller_cross.clone(),
47 Some(caller_cross.clone()),47 CollectionIssuer::User(caller_cross.clone()),
48 CreateCollectionData {48 CreateCollectionData {
49 mode: CollectionMode::NFT,49 mode: CollectionMode::NFT,
50 ..Default::default()50 ..Default::default()