git.delta.rocks / unique-network / refs/commits / 460ecccc2904

difftreelog

fix benchmarks

Daniel Shiposha2022-10-21parent: #f2a945f.patch.diff
in: master

5 files changed

modifiedpallets/fungible/src/benchmarking.rsdiffbeforeafterboth
31 create_collection_raw(31 create_collection_raw(
32 owner,32 owner,
33 CollectionMode::Fungible(0),33 CollectionMode::Fungible(0),
34 |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),34 |owner: T::CrossAccountId, data| {
35 <Pallet<T>>::init_collection(owner.clone(), owner, data, Default::default())
36 },
35 FungibleHandle::cast,37 FungibleHandle::cast,
36 )38 )
37}39}
modifiedpallets/refungible/src/benchmarking.rsdiffbeforeafterboth
62 create_collection_raw(62 create_collection_raw(
63 owner,63 owner,
64 CollectionMode::ReFungible,64 CollectionMode::ReFungible,
65 |owner: T::CrossAccountId, data| <Pallet<T>>::init_collection(owner.clone(), owner, data),65 |owner: T::CrossAccountId, data| {
66 <Pallet<T>>::init_collection(owner.clone(), owner, data, Default::default())
67 },
66 RefungibleHandle::cast,68 RefungibleHandle::cast,
67 )69 )
68}70}
modifiedpallets/scheduler/src/benchmarking.rsdiffbeforeafterboth
93 Ok(())93 Ok(())
94}94}
9595
96fn call_and_hash<T: Config>(i: u32) -> (<T as Config>::Call, T::Hash) {96fn call_and_hash<T: Config>(i: u32) -> (<T as Config>::RuntimeCall, T::Hash) {
97 // Essentially a no-op call.97 // Essentially a no-op call.
98 let call: <T as Config>::Call = frame_system::Call::remark { remark: i.encode() }.into();98 let call: <T as Config>::RuntimeCall = frame_system::Call::remark { remark: i.encode() }.into();
99 let hash = T::Hashing::hash_of(&call);99 let hash = T::Hashing::hash_of(&call);
100 (call, hash)100 (call, hash)
101}101}
modifiedpallets/structure/src/benchmarking.rsdiffbeforeafterboth
19use frame_benchmarking::{benchmarks, account};19use frame_benchmarking::{benchmarks, account};
20use frame_support::traits::{Currency, Get};20use frame_support::traits::{Currency, Get};
21use up_data_structs::{21use up_data_structs::{
22 CreateCollectionData, CollectionMode, CreateItemData, CreateNftData, budget::Unlimited,22 CreateCollectionData, CollectionMode, CreateItemData, CollectionFlags, CreateNftData,
23 budget::Unlimited,
23};24};
24use pallet_common::Config as CommonConfig;25use pallet_common::Config as CommonConfig;
39 CreateCollectionData {
36 mode: CollectionMode::NFT,40 mode: CollectionMode::NFT,
37 ..Default::default()41 ..Default::default()
38 })?;42 },
43 CollectionFlags::default(),
44 )?;
39 let dispatch = T::CollectionDispatch::dispatch(CollectionHandle::try_get(CollectionId(1))?);45 let dispatch = T::CollectionDispatch::dispatch(CollectionHandle::try_get(CollectionId(1))?);
40 let dispatch = dispatch.as_dyn();46 let dispatch = dispatch.as_dyn();
modifiedruntime/common/runtime_apis.rsdiffbeforeafterboth
683 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]683 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
684 list_benchmark!(list, extra, pallet_refungible, Refungible);684 list_benchmark!(list, extra, pallet_refungible, Refungible);
685685
686 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]686 // #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
687 list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler);687 // list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler);
688688
689 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]689 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
690 list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);690 list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);
743 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]743 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
744 add_benchmark!(params, batches, pallet_refungible, Refungible);744 add_benchmark!(params, batches, pallet_refungible, Refungible);
745745
746 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]746 // #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
747 add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler);747 // add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler);
748748
749 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]749 #[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
750 add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);750 add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);