git.delta.rocks / unique-network / refs/commits / e1169bbf349b

difftreelog

feat(rmrk) benchmark set_priority

Daniel Shiposha2022-06-09parent: #b9346ed.patch.diff
in: master

1 file changed

modifiedpallets/proxy-rmrk-core/src/benchmarking.rsdiffbeforeafterboth
18 vec![b'A'; S::get() as usize].try_into().expect("size == S")18 vec![b'A'; S::get() as usize].try_into().expect("size == S")
19}19}
20
21fn create_priorities<S: Get<u32>>() -> BoundedVec<RmrkResourceId, S> {
22 vec![0; S::get() as usize].try_into().expect("size == S")
23}
2024
21fn create_max_collection<T: Config>(owner: &T::AccountId) -> DispatchResult {25fn create_max_collection<T: Config>(owner: &T::AccountId) -> DispatchResult {
22 <T as pallet_common::Config>::Currency::deposit_creating(owner, T::CollectionCreationPrice::get());26 <T as pallet_common::Config>::Currency::deposit_creating(owner, T::CollectionCreationPrice::get());
222 value226 value
223 )227 )
228
229 set_priority {
230 let caller: T::AccountId = account("caller", 0, SEED);
231 create_max_collection::<T>(&caller)?;
232 let collection_id = 0;
233
234 let mut nft_builder = NftBuilder::new(collection_id);
235 let nft_id = nft_builder.build_tower::<T>(&caller, NESTING_BUDGET - 1)?;
236 let priorities = create_priorities();
237 }: _(
238 RawOrigin::Signed(caller),
239 collection_id,
240 nft_id,
241 priorities
242 )
224}243}
225244