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

difftreelog

feat(rmrk) benchmark accept_resource

Daniel Shiposha2022-06-10parent: #817ca0f.patch.diff
in: master

1 file changed

modifiedpallets/proxy-rmrk-core/src/benchmarking.rsdiffbeforeafterboth
349 resource_id349 resource_id
350 )350 )
351
352 accept_resource {
353 let caller: T::AccountId = account("caller", 0, SEED);
354 let admin: T::AccountId = account("admin", 0, SEED);
355
356 <T as pallet_common::Config>::Currency::deposit_creating(&admin, T::CollectionCreationPrice::get());
357
358 create_max_collection::<T>(&admin)?;
359 let collection_id = 0;
360
361 let mut nft_builder = NftBuilder::new(collection_id);
362 let root_nft_id = 1;
363 let nested_nft_id = nft_builder.build_tower::<T>(&admin, NESTING_BUDGET - 1)?;
364 let resource = create_basic_resource();
365
366 let new_owner = <RmrkAccountIdOrCollectionNftTuple<T::AccountId>>::AccountId(caller.clone());
367
368 <Pallet<T>>::send(
369 RawOrigin::Signed(admin.clone()).into(),
370 collection_id,
371 root_nft_id,
372 new_owner,
373 )?;
374
375 <Pallet<T>>::add_basic_resource(
376 RawOrigin::Signed(admin.clone()).into(),
377 collection_id,
378 nested_nft_id,
379 resource
380 )?;
381
382 let resource_id = 1;
383 }: _(
384 RawOrigin::Signed(caller),
385 collection_id,
386 nested_nft_id,
387 resource_id
388 )
351389
352 accept_resource_removal {390 accept_resource_removal {
353 let caller: T::AccountId = account("caller", 0, SEED);391 let caller: T::AccountId = account("caller", 0, SEED);