From 0f77c1087f67de0f3d3f8ce7b70abdb92647a7c7 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Mon, 27 Nov 2023 17:32:30 +0000 Subject: [PATCH] fix: benchmarks --- --- 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| { - >::init_collection(owner.clone(), Some(owner), false, data) + >::init_collection(owner.clone(), CollectionIssuer::User(owner), data) }, |h| h, ) --- a/pallets/fungible/src/benchmarking.rs +++ b/pallets/fungible/src/benchmarking.rs @@ -15,7 +15,9 @@ // along with Unique Network. If not, see . 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| { - >::init_collection(owner.clone(), Some(owner), false, data) + >::init_collection(owner.clone(), CollectionIssuer::User(owner), data) }, FungibleHandle::cast, ) --- 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| { - >::init_collection(owner.clone(), Some(owner), false, data) + >::init_collection(owner.clone(), CollectionIssuer::User(owner), data) }, NonfungibleHandle::cast, ) --- 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| { - >::init_collection(owner.clone(), Some(owner), false, data) + >::init_collection(owner.clone(), CollectionIssuer::User(owner), data) }, RefungibleHandle::cast, ) --- a/pallets/structure/src/benchmarking.rs +++ b/pallets/structure/src/benchmarking.rs @@ -16,7 +16,7 @@ use frame_benchmarking::v2::{account, benchmarks, BenchmarkError}; use frame_support::traits::{fungible::Balanced, tokens::Precision, Get}; -use pallet_common::Config as CommonConfig; +use pallet_common::{CollectionIssuer, Config as CommonConfig}; use pallet_evm::account::CrossAccountId; use sp_std::vec; use up_data_structs::{ @@ -44,7 +44,7 @@ .unwrap(); T::CollectionDispatch::create( caller_cross.clone(), - Some(caller_cross.clone()), + CollectionIssuer::User(caller_cross.clone()), CreateCollectionData { mode: CollectionMode::NFT, ..Default::default() -- gitstuff