git.delta.rocks / unique-network / refs/commits / 65414d643dd4

difftreelog

feat(app-promo) types for `Currency` trait support has been removed & bench fix

PraetorP2023-06-23parent: #c575769.patch.diff
in: master

8 files changed

modifiedCargo.lockdiffbeforeafterboth
61296129
6130[[package]]6130[[package]]
6131name = "pallet-app-promotion"6131name = "pallet-app-promotion"
6132version = "0.2.0"6132version = "0.2.1"
6133dependencies = [6133dependencies = [
6134 "frame-benchmarking",6134 "frame-benchmarking",
6135 "frame-support",6135 "frame-support",
6136 "frame-system",6136 "frame-system",
6137 "log",6137 "log",
6138 "pallet-balances",
6139 "pallet-common",6138 "pallet-common",
6140 "pallet-configuration",6139 "pallet-configuration",
6141 "pallet-evm",6140 "pallet-evm",
modifiedpallets/app-promotion/CHANGELOG.mddiffbeforeafterboth
3All notable changes to this project will be documented in this file.3All notable changes to this project will be documented in this file.
44
5<!-- bureaucrate goes here -->5<!-- bureaucrate goes here -->
6
7## [0.2.1] - 2023-06-23
8
9### Changed
10
11- Removed types associated with support for `Currency` trait.
12
13### Fixed
14
15- Benchmarks.
16
6## [0.2.0] - 2023-05-1917## [0.2.0] - 2023-05-19
718
8### Changed19### Changed
modifiedpallets/app-promotion/Cargo.tomldiffbeforeafterboth
9license = 'GPLv3'9license = 'GPLv3'
10name = 'pallet-app-promotion'10name = 'pallet-app-promotion'
11repository = 'https://github.com/UniqueNetwork/unique-chain'11repository = 'https://github.com/UniqueNetwork/unique-chain'
12version = '0.2.0'12version = '0.2.1'
1313
14[package.metadata.docs.rs]14[package.metadata.docs.rs]
15targets = ['x86_64-unknown-linux-gnu']15targets = ['x86_64-unknown-linux-gnu']
27 'frame-benchmarking/std',27 'frame-benchmarking/std',
28 'frame-support/std',28 'frame-support/std',
29 'frame-system/std',29 'frame-system/std',
30 'pallet-balances/std',
31 'pallet-evm/std',30 'pallet-evm/std',
32 'sp-core/std',31 'sp-core/std',
33 'sp-runtime/std',32 'sp-runtime/std',
48frame-benchmarking = { workspace = true, optional = true }47frame-benchmarking = { workspace = true, optional = true }
49frame-support = { workspace = true }48frame-support = { workspace = true }
50frame-system = { workspace = true }49frame-system = { workspace = true }
51pallet-balances = { features = ["insecure_zero_ed"], workspace = true }50
52pallet-evm = { workspace = true }51pallet-evm = { workspace = true }
53sp-core = { workspace = true }52sp-core = { workspace = true }
54sp-runtime = { workspace = true }53sp-runtime = { workspace = true }
modifiedpallets/app-promotion/src/benchmarking.rsdiffbeforeafterboth
1818
19use super::*;19use super::*;
20use crate::Pallet as PromototionPallet;20use crate::Pallet as PromototionPallet;
2121use frame_support::traits::fungible::Unbalanced;
22use sp_runtime::traits::Bounded;22use sp_runtime::traits::Bounded;
2323
24use frame_benchmarking::{benchmarks, account};24use frame_benchmarking::{benchmarks, account};
6363
64 (0..b).try_for_each(|index| {64 (0..b).try_for_each(|index| {
65 let staker = account::<T::AccountId>("staker", index, SEED);65 let staker = account::<T::AccountId>("staker", index, SEED);
66 <T as Config>::Currency::set_balance(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());66 <T as Config>::Currency::write_balance(&staker, Into::<BalanceOf<T>>::into(10_000u128) * T::Nominal::get())?;
67 PromototionPallet::<T>::stake(RawOrigin::Signed(staker.clone()).into(), Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get())?;67 PromototionPallet::<T>::stake(RawOrigin::Signed(staker.clone()).into(), Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get())?;
68 PromototionPallet::<T>::unstake_all(RawOrigin::Signed(staker.clone()).into())?;68 PromototionPallet::<T>::unstake_all(RawOrigin::Signed(staker).into())?;
69 Result::<(), sp_runtime::DispatchError>::Ok(())69 Result::<(), sp_runtime::DispatchError>::Ok(())
70 })?;70 })?;
71 let block_number = <frame_system::Pallet<T>>::current_block_number() + T::PendingInterval::get();71 let block_number = <frame_system::Pallet<T>>::current_block_number() + T::PendingInterval::get();
82 let pallet_admin = account::<T::AccountId>("admin", 1, SEED);82 let pallet_admin = account::<T::AccountId>("admin", 1, SEED);
83 let share = Perbill::from_rational(1u32, 20);83 let share = Perbill::from_rational(1u32, 20);
84 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;84 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
85 <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());85 <T as Config>::Currency::write_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value())?;
86 <T as Config>::Currency::set_balance(&<T as pallet::Config>::TreasuryAccountId::get(), Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());86 <T as Config>::Currency::write_balance(&<T as pallet::Config>::TreasuryAccountId::get(), Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value())?;
8787
88 let stakers: Vec<T::AccountId> = (0..b).map(|index| account("staker", index, SEED)).collect();88 let stakers: Vec<T::AccountId> = (0..b).map(|index| account("staker", index, SEED)).collect();
89 stakers.iter().for_each(|staker| {89 stakers.iter().try_for_each(|staker| {
90 <T as Config>::Currency::set_balance(&staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());90 <T as Config>::Currency::write_balance(staker, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value())?;
91 Result::<(), sp_runtime::DispatchError>::Ok(())
91 });92 })?;
92 (1..11).try_for_each(|i| {93 (1..11).try_for_each(|i| {
93 <frame_system::Pallet<T>>::set_block_number(i.into());94 <frame_system::Pallet<T>>::set_block_number(i.into());
94 T::RelayBlockNumberProvider::set_block_number((2*i).into());95 T::RelayBlockNumberProvider::set_block_number((2*i).into());
102 Result::<(), sp_runtime::DispatchError>::Ok(())103 Result::<(), sp_runtime::DispatchError>::Ok(())
103 })?;104 })?;
104105
105 let stakes = Staked::<T>::iter_prefix((&stakers[0],)).into_iter().collect::<Vec<_>>();106 let stakes = Staked::<T>::iter_prefix((&stakers[0],)).collect::<Vec<_>>();
106 assert_eq!(stakes.len(), 10);107 assert_eq!(stakes.len(), 10);
107108
108 <frame_system::Pallet<T>>::set_block_number(15_000.into());109 <frame_system::Pallet<T>>::set_block_number(15_000.into());
112 stake {113 stake {
113 let caller = account::<T::AccountId>("caller", 0, SEED);114 let caller = account::<T::AccountId>("caller", 0, SEED);
114 let share = Perbill::from_rational(1u32, 10);115 let share = Perbill::from_rational(1u32, 10);
115 let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());116 let _ = <T as Config>::Currency::write_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
116 } : _(RawOrigin::Signed(caller.clone()), share * <T as Config>::Currency::total_balance(&caller))117 } : _(RawOrigin::Signed(caller.clone()), share * <T as Config>::Currency::total_balance(&caller))
117118
118 unstake_all {119 unstake_all {
119 let caller = account::<T::AccountId>("caller", 0, SEED);120 let caller = account::<T::AccountId>("caller", 0, SEED);
120 let share = Perbill::from_rational(1u32, 20);121 let share = Perbill::from_rational(1u32, 20);
121 let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());122 let _ = <T as Config>::Currency::write_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
122 (1..11).map(|i| {123 (1..11).map(|i| {
123 // used to change block number124 // used to change block number
124 <frame_system::Pallet<T>>::set_block_number(i.into());125 <frame_system::Pallet<T>>::set_block_number(i.into());
133 unstake_partial {134 unstake_partial {
134 let caller = account::<T::AccountId>("caller", 0, SEED);135 let caller = account::<T::AccountId>("caller", 0, SEED);
135 let share = Perbill::from_rational(1u32, 20);136 let share = Perbill::from_rational(1u32, 20);
136 let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());137 let _ = <T as Config>::Currency::write_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
137 (1..11).map(|i| {138 (1..11).map(|i| {
138 // used to change block number139 // used to change block number
139 <frame_system::Pallet<T>>::set_block_number(i.into());140 <frame_system::Pallet<T>>::set_block_number(i.into());
148 sponsor_collection {149 sponsor_collection {
149 let pallet_admin = account::<T::AccountId>("admin", 0, SEED);150 let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
150 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;151 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
151 let _ = <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());152 let _ = <T as Config>::Currency::write_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
152 let caller: T::AccountId = account("caller", 0, SEED);153 let caller: T::AccountId = account("caller", 0, SEED);
153 let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());154 let _ = <T as Config>::Currency::write_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
154 let collection = create_nft_collection::<T>(caller.clone())?;155 let collection = create_nft_collection::<T>(caller)?;
155 } : _(RawOrigin::Signed(pallet_admin.clone()), collection)156 } : _(RawOrigin::Signed(pallet_admin.clone()), collection)
156157
157 stop_sponsoring_collection {158 stop_sponsoring_collection {
158 let pallet_admin = account::<T::AccountId>("admin", 0, SEED);159 let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
159 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;160 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
160 let _ = <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());161 let _ = <T as Config>::Currency::write_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
161 let caller: T::AccountId = account("caller", 0, SEED);162 let caller: T::AccountId = account("caller", 0, SEED);
162 let _ = <T as Config>::Currency::set_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());163 let _ = <T as Config>::Currency::write_balance(&caller, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
163 let collection = create_nft_collection::<T>(caller.clone())?;164 let collection = create_nft_collection::<T>(caller)?;
164 PromototionPallet::<T>::sponsor_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?;165 PromototionPallet::<T>::sponsor_collection(RawOrigin::Signed(pallet_admin.clone()).into(), collection)?;
165 } : _(RawOrigin::Signed(pallet_admin.clone()), collection)166 } : _(RawOrigin::Signed(pallet_admin.clone()), collection)
166167
167 sponsor_contract {168 sponsor_contract {
168 let pallet_admin = account::<T::AccountId>("admin", 0, SEED);169 let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
169 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;170 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
170171
171 let _ = <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());172 let _ = <T as Config>::Currency::write_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
172 let address = H160::from_low_u64_be(SEED as u64);173 let address = H160::from_low_u64_be(SEED as u64);
173 let data: Vec<u8> = (0..20 as u8).collect();174 let data: Vec<u8> = (0..20).collect();
174 <EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;175 <EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;
175 <EvmMigrationPallet<T>>::finish(RawOrigin::Root.into(), address, data)?;176 <EvmMigrationPallet<T>>::finish(RawOrigin::Root.into(), address, data)?;
176 } : _(RawOrigin::Signed(pallet_admin.clone()), address)177 } : _(RawOrigin::Signed(pallet_admin.clone()), address)
179 let pallet_admin = account::<T::AccountId>("admin", 0, SEED);180 let pallet_admin = account::<T::AccountId>("admin", 0, SEED);
180 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;181 PromototionPallet::<T>::set_admin_address(RawOrigin::Root.into(), T::CrossAccountId::from_sub(pallet_admin.clone()))?;
181182
182 let _ = <T as Config>::Currency::set_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());183 let _ = <T as Config>::Currency::write_balance(&pallet_admin, Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value());
183 let address = H160::from_low_u64_be(SEED as u64);184 let address = H160::from_low_u64_be(SEED as u64);
184 let data: Vec<u8> = (0..20 as u8).collect();185 let data: Vec<u8> = (0..20).collect();
185 <EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;186 <EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;
186 <EvmMigrationPallet<T>>::finish(RawOrigin::Root.into(), address, data)?;187 <EvmMigrationPallet<T>>::finish(RawOrigin::Root.into(), address, data)?;
187 PromototionPallet::<T>::sponsor_contract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?;188 PromototionPallet::<T>::sponsor_contract(RawOrigin::Signed(pallet_admin.clone()).into(), address)?;
modifiedpallets/app-promotion/src/lib.rsdiffbeforeafterboth
54pub mod weights;54pub mod weights;
5555
56use sp_std::{56use sp_std::{vec::Vec, vec, iter::Sum, borrow::ToOwned, cell::RefCell};
57 vec::{Vec},
58 vec,
59 iter::Sum,
60 borrow::ToOwned,
61 cell::RefCell,
62};
63use sp_core::H160;57use sp_core::H160;
64use codec::EncodeLike;58use codec::EncodeLike;
65use pallet_balances::BalanceLock;
66pub use types::*;59pub use types::*;
6760
68use up_data_structs::CollectionId;61use up_data_structs::CollectionId;
6962
70use frame_support::{63use frame_support::{
71 dispatch::{DispatchResult},64 dispatch::{DispatchResult},
72 traits::{65 traits::{
73 Get, LockableCurrency,66 Get,
74 tokens::Balance,67 tokens::Balance,
75 fungible::{Inspect, InspectFreeze, Mutate, MutateFreeze},68 fungible::{Inspect, InspectFreeze, Mutate, MutateFreeze},
76 },69 },
87 ArithmeticError, DispatchError,80 ArithmeticError, DispatchError,
88};81};
89
90pub const LOCK_IDENTIFIER: [u8; 8] = *b"appstake";
9182
92const PENDING_LIMIT_PER_BLOCK: u32 = 3;83const PENDING_LIMIT_PER_BLOCK: u32 = 3;
9384
110 /// Type to interact with the native token101 /// Type to interact with the native token
111 type Currency: MutateFreeze<Self::AccountId>102 type Currency: MutateFreeze<Self::AccountId> + Mutate<Self::AccountId>;
112 + Mutate<Self::AccountId>
113 + ExtendedLockableCurrency<
114 Self::AccountId,
115 Balance = <<Self as Config>::Currency as Inspect<Self::AccountId>>::Balance,
116 >;
117103
118 /// Type for interacting with collections104 /// Type for interacting with collections
119 type CollectionHandler: CollectionHandler<105 type CollectionHandler: CollectionHandler<
705 Ok(())691 Ok(())
706 }692 }
707
708 /// Migrates lock state into freeze one
709 ///
710 /// # Permissions
711 ///
712 /// * Sudo
713 ///
714 /// # Arguments
715 ///
716 /// * `origin`: Must be `Root`.
717 /// * `stakers`: Accounts to be upgraded.
718 #[pallet::call_index(9)]
719 #[pallet::weight(T::DbWeight::get().reads_writes(2, 2) * stakers.len() as u64)]
720 pub fn upgrade_accounts(
721 origin: OriginFor<T>,
722 stakers: Vec<T::AccountId>,
723 ) -> DispatchResult {
724 ensure_root(origin)?;
725
726 stakers
727 .into_iter()
728 .try_for_each(|s| -> Result<_, DispatchError> {
729 if let Some(BalanceLock { amount, .. }) = Self::get_locked_balance(&s) {
730 if Self::get_frozen_balance(&s).is_some() {
731 return Err(Error::<T>::InconsistencyState.into());
732 }
733
734 <<T as Config>::Currency as LockableCurrency<T::AccountId>>::remove_lock(
735 LOCK_IDENTIFIER,
736 &s,
737 );
738
739 Self::set_freeze_with_result(&s, amount)?;
740 Ok(())
741 } else {
742 Ok(())
743 }
744 })?;
745
746 Ok(())
747 }
748693
749 /// Called for blocks that, for some reason, have not been unstacked694 /// Called for blocks that, for some reason, have not been unstacked
750 ///695 ///
756 ///701 ///
757 /// * `origin`: Must be `Root`.702 /// * `origin`: Must be `Root`.
758 /// * `pending_blocks`: Block numbers that will be processed.703 /// * `pending_blocks`: Block numbers that will be processed.
759 #[pallet::call_index(10)]704 #[pallet::call_index(9)]
760 #[pallet::weight(<T as Config>::WeightInfo::on_initialize(PENDING_LIMIT_PER_BLOCK*pending_blocks.len() as u32))]705 #[pallet::weight(<T as Config>::WeightInfo::on_initialize(PENDING_LIMIT_PER_BLOCK*pending_blocks.len() as u32))]
761 pub fn force_unstake(706 pub fn force_unstake(
762 origin: OriginFor<T>,707 origin: OriginFor<T>,
935 }880 }
936 }881 }
937
938 /// Returns the balance locked by the pallet for the staker.
939 ///
940 /// - `staker`: staker account.
941 pub fn get_locked_balance(
942 staker: impl EncodeLike<T::AccountId>,
943 ) -> Option<BalanceLock<BalanceOf<T>>> {
944 <<T as Config>::Currency as ExtendedLockableCurrency<T::AccountId>>::locks(staker)
945 .into_iter()
946 .find(|l| l.id == LOCK_IDENTIFIER)
947 }
948882
949 /// Returns the balance frozen by the pallet for the staker.883 /// Returns the balance frozen by the pallet for the staker.
950 ///884 ///
modifiedpallets/app-promotion/src/types.rsdiffbeforeafterboth
1use codec::EncodeLike;
2use frame_support::{traits::LockableCurrency, WeakBoundedVec, Parameter, dispatch::DispatchResult};1use frame_support::{dispatch::DispatchResult};
32
4use pallet_balances::{BalanceLock, Config as BalancesConfig, Pallet as PalletBalances};
5use pallet_common::CollectionHandle;3use pallet_common::CollectionHandle;
64
7use sp_runtime::{DispatchError, Perbill};5use sp_runtime::{DispatchError, Perbill};
14const MAX_NUMBER_PAYOUTS: u8 = 100;12const MAX_NUMBER_PAYOUTS: u8 = 100;
15pub(crate) const DEFAULT_NUMBER_PAYOUTS: u8 = 20;13pub(crate) const DEFAULT_NUMBER_PAYOUTS: u8 = 20;
1614
17/// This trait was defined because `LockableCurrency`
18/// has no way to know the state of the lock for an account.
19pub trait ExtendedLockableCurrency<AccountId: Parameter>: LockableCurrency<AccountId> {
20 /// Returns lock balance for an account. Allows to determine the cause of the lock.
21 fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>
22 where
23 KArg: EncodeLike<AccountId>;
24}
25
26impl<T: BalancesConfig<I>, I: 'static> ExtendedLockableCurrency<T::AccountId>
27 for PalletBalances<T, I>
28{
29 fn locks<KArg>(who: KArg) -> WeakBoundedVec<BalanceLock<Self::Balance>, Self::MaxLocks>
30 where
31 KArg: EncodeLike<T::AccountId>,
32 {
33 Self::locks(who)
34 }
35}
36/// Trait for interacting with collections.15/// Trait for interacting with collections.
37pub trait CollectionHandler {16pub trait CollectionHandler {
38 type CollectionId;17 type CollectionId;
modifiedpallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth
200 value: property_value(),200 value: property_value(),
201 }).collect::<Vec<_>>();201 }).collect::<Vec<_>>();
202 let item = create_max_item(&collection, &owner, owner.clone())?;202 let item = create_max_item(&collection, &owner, owner.clone())?;
203 }: {<Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?}203 }: {<Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), SetPropertyMode::ExistingToken, &Unlimited)?}
204204
205 delete_token_properties {205 delete_token_properties {
206 let b in 0..MAX_PROPERTIES_PER_ITEM;206 let b in 0..MAX_PROPERTIES_PER_ITEM;
222 value: property_value(),222 value: property_value(),
223 }).collect::<Vec<_>>();223 }).collect::<Vec<_>>();
224 let item = create_max_item(&collection, &owner, owner.clone())?;224 let item = create_max_item(&collection, &owner, owner.clone())?;
225 <Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?;225 <Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), SetPropertyMode::ExistingToken, &Unlimited)?;
226 let to_delete = (0..b).map(|k| property_key(k as usize)).collect::<Vec<_>>();226 let to_delete = (0..b).map(|k| property_key(k as usize)).collect::<Vec<_>>();
227 }: {<Pallet<T>>::delete_token_properties(&collection, &owner, item, to_delete.into_iter(), &Unlimited)?}227 }: {<Pallet<T>>::delete_token_properties(&collection, &owner, item, to_delete.into_iter(), &Unlimited)?}
228228
modifiedpallets/refungible/src/benchmarking.rsdiffbeforeafterboth
257 value: property_value(),257 value: property_value(),
258 }).collect::<Vec<_>>();258 }).collect::<Vec<_>>();
259 let item = create_max_item(&collection, &owner, [(owner.clone(), 200)])?;259 let item = create_max_item(&collection, &owner, [(owner.clone(), 200)])?;
260 }: {<Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?}260 }: {<Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), SetPropertyMode::ExistingToken, &Unlimited)?}
261261
262 delete_token_properties {262 delete_token_properties {
263 let b in 0..MAX_PROPERTIES_PER_ITEM;263 let b in 0..MAX_PROPERTIES_PER_ITEM;
279 value: property_value(),279 value: property_value(),
280 }).collect::<Vec<_>>();280 }).collect::<Vec<_>>();
281 let item = create_max_item(&collection, &owner, [(owner.clone(), 200)])?;281 let item = create_max_item(&collection, &owner, [(owner.clone(), 200)])?;
282 <Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), false, &Unlimited)?;282 <Pallet<T>>::set_token_properties(&collection, &owner, item, props.into_iter(), SetPropertyMode::ExistingToken, &Unlimited)?;
283 let to_delete = (0..b).map(|k| property_key(k as usize)).collect::<Vec<_>>();283 let to_delete = (0..b).map(|k| property_key(k as usize)).collect::<Vec<_>>();
284 }: {<Pallet<T>>::delete_token_properties(&collection, &owner, item, to_delete.into_iter(), &Unlimited)?}284 }: {<Pallet<T>>::delete_token_properties(&collection, &owner, item, to_delete.into_iter(), &Unlimited)?}
285285