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
33 MAX_COLLECTION_NAME_LENGTH, MAX_PROPERTIES_PER_ITEM, MAX_TOKEN_PREFIX_LENGTH,33 MAX_COLLECTION_NAME_LENGTH, MAX_PROPERTIES_PER_ITEM, MAX_TOKEN_PREFIX_LENGTH,
34};34};
3535
36use crate::{BenchmarkPropertyWriter, CollectionHandle, Config, Pallet};36use crate::{BenchmarkPropertyWriter, CollectionHandle, CollectionIssuer, Config, Pallet};
3737
38const SEED: u32 = 1;38const SEED: u32 = 1;
3939
121 owner,121 owner,
122 CollectionMode::NFT,122 CollectionMode::NFT,
123 |owner: T::CrossAccountId, data| {123 |owner: T::CrossAccountId, data| {
124 <Pallet<T>>::init_collection(owner.clone(), Some(owner), false, data)124 <Pallet<T>>::init_collection(owner.clone(), CollectionIssuer::User(owner), data)
125 },125 },
126 |h| h,126 |h| h,
127 )127 )
modifiedpallets/fungible/src/benchmarking.rsdiffbeforeafterboth
1616
17use frame_benchmarking::{account, v2::*};17use frame_benchmarking::{account, v2::*};
18use pallet_common::{bench_init, benchmarking::create_collection_raw, Pallet as PalletCommon};18use pallet_common::{
19 bench_init, benchmarking::create_collection_raw, CollectionIssuer, Pallet as PalletCommon,
20};
19use sp_std::prelude::*;21use sp_std::prelude::*;
20use up_data_structs::{budget::Unlimited, CollectionMode, MAX_ITEMS_PER_BATCH};22use up_data_structs::{budget::Unlimited, CollectionMode, MAX_ITEMS_PER_BATCH};
31 owner,33 owner,
32 CollectionMode::Fungible(0),34 CollectionMode::Fungible(0),
33 |owner: T::CrossAccountId, data| {35 |owner: T::CrossAccountId, data| {
34 <PalletCommon<T>>::init_collection(owner.clone(), Some(owner), false, data)36 <PalletCommon<T>>::init_collection(owner.clone(), CollectionIssuer::User(owner), data)
35 },37 },
36 FungibleHandle::cast,38 FungibleHandle::cast,
37 )39 )
modifiedpallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth
18use pallet_common::{18use pallet_common::{
19 bench_init,19 bench_init,
20 benchmarking::{create_collection_raw, property_key, property_value},20 benchmarking::{create_collection_raw, property_key, property_value},
21 Pallet as PalletCommon,21 CollectionIssuer, Pallet as PalletCommon,
22};22};
23use sp_std::prelude::*;23use sp_std::prelude::*;
24use up_data_structs::{24use up_data_structs::{
58 owner,58 owner,
59 CollectionMode::NFT,59 CollectionMode::NFT,
60 |owner: T::CrossAccountId, data| {60 |owner: T::CrossAccountId, data| {
61 <PalletCommon<T>>::init_collection(owner.clone(), Some(owner), false, data)61 <PalletCommon<T>>::init_collection(owner.clone(), CollectionIssuer::User(owner), data)
62 },62 },
63 NonfungibleHandle::cast,63 NonfungibleHandle::cast,
64 )64 )
modifiedpallets/refungible/src/benchmarking.rsdiffbeforeafterboth
20use pallet_common::{20use pallet_common::{
21 bench_init,21 bench_init,
22 benchmarking::{create_collection_raw, property_key, property_value},22 benchmarking::{create_collection_raw, property_key, property_value},
23 Pallet as PalletCommon,23 CollectionIssuer, Pallet as PalletCommon,
24};24};
25use sp_std::prelude::*;25use sp_std::prelude::*;
26use up_data_structs::{26use up_data_structs::{
63 owner,63 owner,
64 CollectionMode::ReFungible,64 CollectionMode::ReFungible,
65 |owner: T::CrossAccountId, data| {65 |owner: T::CrossAccountId, data| {
66 <PalletCommon<T>>::init_collection(owner.clone(), Some(owner), false, data)66 <PalletCommon<T>>::init_collection(owner.clone(), CollectionIssuer::User(owner), data)
67 },67 },
68 RefungibleHandle::cast,68 RefungibleHandle::cast,
69 )69 )
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()