From 460ecccc290493b372bdbb85deea5d09cea94c1e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 21 Oct 2022 13:35:19 +0000 Subject: [PATCH] fix: benchmarks --- --- a/pallets/fungible/src/benchmarking.rs +++ b/pallets/fungible/src/benchmarking.rs @@ -31,7 +31,9 @@ create_collection_raw( owner, CollectionMode::Fungible(0), - |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data), + |owner: T::CrossAccountId, data| { + >::init_collection(owner.clone(), owner, data, Default::default()) + }, FungibleHandle::cast, ) } --- a/pallets/refungible/src/benchmarking.rs +++ b/pallets/refungible/src/benchmarking.rs @@ -62,7 +62,9 @@ create_collection_raw( owner, CollectionMode::ReFungible, - |owner: T::CrossAccountId, data| >::init_collection(owner.clone(), owner, data), + |owner: T::CrossAccountId, data| { + >::init_collection(owner.clone(), owner, data, Default::default()) + }, RefungibleHandle::cast, ) } --- a/pallets/scheduler/src/benchmarking.rs +++ b/pallets/scheduler/src/benchmarking.rs @@ -93,9 +93,9 @@ Ok(()) } -fn call_and_hash(i: u32) -> (::Call, T::Hash) { +fn call_and_hash(i: u32) -> (::RuntimeCall, T::Hash) { // Essentially a no-op call. - let call: ::Call = frame_system::Call::remark { remark: i.encode() }.into(); + let call: ::RuntimeCall = frame_system::Call::remark { remark: i.encode() }.into(); let hash = T::Hashing::hash_of(&call); (call, hash) } --- a/pallets/structure/src/benchmarking.rs +++ b/pallets/structure/src/benchmarking.rs @@ -19,7 +19,8 @@ use frame_benchmarking::{benchmarks, account}; use frame_support::traits::{Currency, Get}; use up_data_structs::{ - CreateCollectionData, CollectionMode, CreateItemData, CreateNftData, budget::Unlimited, + CreateCollectionData, CollectionMode, CreateItemData, CollectionFlags, CreateNftData, + budget::Unlimited, }; use pallet_common::Config as CommonConfig; use pallet_evm::account::CrossAccountId; @@ -32,10 +33,15 @@ let caller_cross = T::CrossAccountId::from_sub(caller.clone()); ::Currency::deposit_creating(&caller, T::CollectionCreationPrice::get()); - T::CollectionDispatch::create(caller_cross.clone(), caller_cross.clone(), CreateCollectionData { - mode: CollectionMode::NFT, - ..Default::default() - })?; + T::CollectionDispatch::create( + caller_cross.clone(), + caller_cross.clone(), + CreateCollectionData { + mode: CollectionMode::NFT, + ..Default::default() + }, + CollectionFlags::default(), + )?; let dispatch = T::CollectionDispatch::dispatch(CollectionHandle::try_get(CollectionId(1))?); let dispatch = dispatch.as_dyn(); --- a/runtime/common/runtime_apis.rs +++ b/runtime/common/runtime_apis.rs @@ -683,8 +683,8 @@ #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] list_benchmark!(list, extra, pallet_refungible, Refungible); - #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] - list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler); + // #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] + // list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler); #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore); @@ -743,8 +743,8 @@ #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] add_benchmark!(params, batches, pallet_refungible, Refungible); - #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] - add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler); + // #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] + // add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler); #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))] add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore); -- gitstuff