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

difftreelog

Rename property change to set

Daniel Shiposha2022-05-04parent: #117d4ce.patch.diff
in: master

11 files changed

modifiedpallets/common/src/lib.rsdiffbeforeafterboth
731 Ok(())731 Ok(())
732 }732 }
733733
734 pub fn change_collection_property(734 pub fn set_collection_property(
735 collection: &CollectionHandle<T>,735 collection: &CollectionHandle<T>,
736 sender: &T::CrossAccountId,736 sender: &T::CrossAccountId,
737 property: Property,737 property: Property,
740740
741 CollectionProperties::<T>::try_mutate(741 CollectionProperties::<T>::try_mutate(
742 collection.id,742 collection.id,
743 |properties| properties.try_change_property(property.clone())743 |properties| properties.try_set_property(property.clone())
744 )?;744 )?;
745745
746 Self::deposit_event(Event::CollectionPropertySet(collection.id, property));746 Self::deposit_event(Event::CollectionPropertySet(collection.id, property));
747747
748 Ok(())748 Ok(())
749 }749 }
750750
751 pub fn change_collection_properties(751 pub fn set_collection_properties(
752 collection: &CollectionHandle<T>,752 collection: &CollectionHandle<T>,
753 sender: &T::CrossAccountId,753 sender: &T::CrossAccountId,
754 properties: Vec<Property>,754 properties: Vec<Property>,
755 ) -> DispatchResult {755 ) -> DispatchResult {
756 for property in properties {756 for property in properties {
757 Self::change_collection_property(collection, sender, property)?;757 Self::set_collection_property(collection, sender, property)?;
758 }758 }
759759
760 Ok(())760 Ok(())
761 }761 }
762762
763 pub fn change_property_permission(763 pub fn set_property_permission(
764 collection: &CollectionHandle<T>,764 collection: &CollectionHandle<T>,
765 sender: &T::CrossAccountId,765 sender: &T::CrossAccountId,
766 property_permission: PropertyKeyPermission766 property_permission: PropertyKeyPermission
784 Ok(())784 Ok(())
785 }785 }
786786
787 pub fn change_property_permissions(787 pub fn set_property_permissions(
788 collection: &CollectionHandle<T>,788 collection: &CollectionHandle<T>,
789 sender: &T::CrossAccountId,789 sender: &T::CrossAccountId,
790 property_permissions: Vec<PropertyKeyPermission>790 property_permissions: Vec<PropertyKeyPermission>
791 ) -> DispatchResult {791 ) -> DispatchResult {
792 for prop_pemission in property_permissions {792 for prop_pemission in property_permissions {
793 Self::change_property_permission(collection, sender, prop_pemission)?;793 Self::set_property_permission(collection, sender, prop_pemission)?;
794 }794 }
795795
796 Ok(())796 Ok(())
948 fn create_multiple_items(amount: u32) -> Weight;948 fn create_multiple_items(amount: u32) -> Weight;
949 fn create_multiple_items_ex(cost: &CreateItemExData<CrossAccountId>) -> Weight;949 fn create_multiple_items_ex(cost: &CreateItemExData<CrossAccountId>) -> Weight;
950 fn burn_item() -> Weight;950 fn burn_item() -> Weight;
951 fn change_collection_properties(amount: u32) -> Weight;951 fn set_collection_properties(amount: u32) -> Weight;
952 fn change_token_properties(amount: u32) -> Weight;952 fn set_token_properties(amount: u32) -> Weight;
953 fn change_property_permissions(amount: u32) -> Weight;953 fn set_property_permissions(amount: u32) -> Weight;
954 fn transfer() -> Weight;954 fn transfer() -> Weight;
955 fn approve() -> Weight;955 fn approve() -> Weight;
956 fn transfer_from() -> Weight;956 fn transfer_from() -> Weight;
985 token: TokenId,985 token: TokenId,
986 amount: u128,986 amount: u128,
987 ) -> DispatchResultWithPostInfo;987 ) -> DispatchResultWithPostInfo;
988 fn change_collection_properties(988 fn set_collection_properties(
989 &self,989 &self,
990 sender: T::CrossAccountId,990 sender: T::CrossAccountId,
991 properties: Vec<Property>,991 properties: Vec<Property>,
992 ) -> DispatchResultWithPostInfo;992 ) -> DispatchResultWithPostInfo;
993 fn change_token_properties(993 fn set_token_properties(
994 &self,994 &self,
995 sender: T::CrossAccountId,995 sender: T::CrossAccountId,
996 token_id: TokenId,996 token_id: TokenId,
997 property: Vec<Property>,997 property: Vec<Property>,
998 ) -> DispatchResultWithPostInfo;998 ) -> DispatchResultWithPostInfo;
999 fn change_property_permissions(999 fn set_property_permissions(
1000 &self,1000 &self,
1001 sender: &T::CrossAccountId,1001 sender: &T::CrossAccountId,
1002 property_permissions: Vec<PropertyKeyPermission>,1002 property_permissions: Vec<PropertyKeyPermission>,
modifiedpallets/fungible/src/common.rsdiffbeforeafterboth
50 <SelfWeightOf<T>>::burn_item()50 <SelfWeightOf<T>>::burn_item()
51 }51 }
5252
53 fn change_collection_properties(amount: u32) -> Weight {53 fn set_collection_properties(amount: u32) -> Weight {
54 <SelfWeightOf<T>>::change_collection_properties(amount)54 <SelfWeightOf<T>>::set_collection_properties(amount)
55 }55 }
5656
57 fn change_token_properties(amount: u32) -> Weight {57 fn set_token_properties(amount: u32) -> Weight {
58 <SelfWeightOf<T>>::change_token_properties(amount)58 <SelfWeightOf<T>>::set_token_properties(amount)
59 }59 }
6060
61 fn change_property_permissions(amount: u32) -> Weight {61 fn set_property_permissions(amount: u32) -> Weight {
62 <SelfWeightOf<T>>::change_property_permissions(amount)62 <SelfWeightOf<T>>::set_property_permissions(amount)
63 }63 }
6464
65 fn transfer() -> Weight {65 fn transfer() -> Weight {
237 )237 )
238 }238 }
239239
240 fn change_collection_properties(240 fn set_collection_properties(
241 &self,241 &self,
242 _sender: T::CrossAccountId,242 _sender: T::CrossAccountId,
243 _property: Vec<Property>,243 _property: Vec<Property>,
244 ) -> DispatchResultWithPostInfo {244 ) -> DispatchResultWithPostInfo {
245 fail!(<Error<T>>::PropertiesNotAllowed)245 fail!(<Error<T>>::PropertiesNotAllowed)
246 }246 }
247247
248 fn change_token_properties(248 fn set_token_properties(
249 &self,249 &self,
250 _sender: T::CrossAccountId,250 _sender: T::CrossAccountId,
251 _token_id: TokenId,251 _token_id: TokenId,
254 fail!(<Error<T>>::PropertiesNotAllowed)254 fail!(<Error<T>>::PropertiesNotAllowed)
255 }255 }
256256
257 fn change_property_permissions(257 fn set_property_permissions(
258 &self,258 &self,
259 _sender: &T::CrossAccountId,259 _sender: &T::CrossAccountId,
260 _property_permissions: Vec<PropertyKeyPermission>,260 _property_permissions: Vec<PropertyKeyPermission>,
modifiedpallets/fungible/src/weights.rsdiffbeforeafterboth
35 fn create_item() -> Weight;35 fn create_item() -> Weight;
36 fn create_multiple_items_ex(b: u32, ) -> Weight;36 fn create_multiple_items_ex(b: u32, ) -> Weight;
37 fn burn_item() -> Weight;37 fn burn_item() -> Weight;
38 fn change_collection_properties(amount: u32) -> Weight;38 fn set_collection_properties(amount: u32) -> Weight;
39 fn change_token_properties(amount: u32) -> Weight;39 fn set_token_properties(amount: u32) -> Weight;
40 fn change_property_permissions(amount: u32) -> Weight;40 fn set_property_permissions(amount: u32) -> Weight;
41 fn transfer() -> Weight;41 fn transfer() -> Weight;
42 fn approve() -> Weight;42 fn approve() -> Weight;
43 fn transfer_from() -> Weight;43 fn transfer_from() -> Weight;
73 .saturating_add(T::DbWeight::get().writes(2 as Weight))73 .saturating_add(T::DbWeight::get().writes(2 as Weight))
74 }74 }
7575
76 fn change_collection_properties(amount: u32) -> Weight {76 fn set_collection_properties(amount: u32) -> Weight {
77 // Error77 // Error
78 078 0
79 }79 }
8080
81 fn change_token_properties(amount: u32) -> Weight {81 fn set_token_properties(amount: u32) -> Weight {
82 // Error82 // Error
83 083 0
84 }84 }
8585
86 fn change_property_permissions(amount: u32) -> Weight {86 fn set_property_permissions(amount: u32) -> Weight {
87 // Error87 // Error
88 088 0
89 }89 }
146 .saturating_add(RocksDbWeight::get().writes(2 as Weight))146 .saturating_add(RocksDbWeight::get().writes(2 as Weight))
147 }147 }
148148
149 fn change_collection_properties(amount: u32) -> Weight {149 fn set_collection_properties(amount: u32) -> Weight {
150 // Error150 // Error
151 0151 0
152 }152 }
153153
154 fn change_token_properties(amount: u32) -> Weight {154 fn set_token_properties(amount: u32) -> Weight {
155 // Error155 // Error
156 0156 0
157 }157 }
158158
159 fn change_property_permissions(amount: u32) -> Weight {159 fn set_property_permissions(amount: u32) -> Weight {
160 // Error160 // Error
161 0161 0
162 }162 }
modifiedpallets/nonfungible/src/common.rsdiffbeforeafterboth
50 <SelfWeightOf<T>>::burn_item()50 <SelfWeightOf<T>>::burn_item()
51 }51 }
5252
53 fn change_collection_properties(amount: u32) -> Weight {53 fn set_collection_properties(amount: u32) -> Weight {
54 <SelfWeightOf<T>>::change_collection_properties(amount)54 <SelfWeightOf<T>>::set_collection_properties(amount)
55 }55 }
5656
57 fn change_token_properties(amount: u32) -> Weight {57 fn set_token_properties(amount: u32) -> Weight {
58 <SelfWeightOf<T>>::change_token_properties(amount)58 <SelfWeightOf<T>>::set_token_properties(amount)
59 }59 }
6060
61 fn change_property_permissions(amount: u32) -> Weight {61 fn set_property_permissions(amount: u32) -> Weight {
62 <SelfWeightOf<T>>::change_property_permissions(amount)62 <SelfWeightOf<T>>::set_property_permissions(amount)
63 }63 }
6464
65 fn transfer() -> Weight {65 fn transfer() -> Weight {
153 )153 )
154 }154 }
155155
156 fn change_collection_properties(156 fn set_collection_properties(
157 &self,157 &self,
158 sender: T::CrossAccountId,158 sender: T::CrossAccountId,
159 properties: Vec<Property>,159 properties: Vec<Property>,
160 ) -> DispatchResultWithPostInfo {160 ) -> DispatchResultWithPostInfo {
161 let weight = <CommonWeights<T>>::change_collection_properties(properties.len() as u32);161 let weight = <CommonWeights<T>>::set_collection_properties(properties.len() as u32);
162162
163 with_weight(163 with_weight(
164 <Pallet<T>>::change_collection_properties(self, &sender, properties),164 <Pallet<T>>::set_collection_properties(self, &sender, properties),
165 weight165 weight
166 )166 )
167 }167 }
168168
169 fn change_token_properties(169 fn set_token_properties(
170 &self,170 &self,
171 sender: T::CrossAccountId,171 sender: T::CrossAccountId,
172 token_id: TokenId,172 token_id: TokenId,
173 properties: Vec<Property>,173 properties: Vec<Property>,
174 ) -> DispatchResultWithPostInfo {174 ) -> DispatchResultWithPostInfo {
175 let weight = <CommonWeights<T>>::change_token_properties(properties.len() as u32);175 let weight = <CommonWeights<T>>::set_token_properties(properties.len() as u32);
176176
177 with_weight(177 with_weight(
178 <Pallet<T>>::change_token_properties(self, &sender, token_id, properties),178 <Pallet<T>>::set_token_properties(self, &sender, token_id, properties),
179 weight179 weight
180 )180 )
181 }181 }
182182
183 fn change_property_permissions(183 fn set_property_permissions(
184 &self,184 &self,
185 sender: &T::CrossAccountId,185 sender: &T::CrossAccountId,
186 property_permissions: Vec<PropertyKeyPermission>,186 property_permissions: Vec<PropertyKeyPermission>,
187 ) -> DispatchResultWithPostInfo {187 ) -> DispatchResultWithPostInfo {
188 let weight = <CommonWeights<T>>::change_property_permissions(property_permissions.len() as u32);188 let weight = <CommonWeights<T>>::set_property_permissions(property_permissions.len() as u32);
189189
190 with_weight(190 with_weight(
191 <Pallet<T>>::change_property_permissions(self, sender, property_permissions),191 <Pallet<T>>::set_property_permissions(self, sender, property_permissions),
192 weight192 weight
193 )193 )
194 }194 }
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
255 Ok(())255 Ok(())
256 }256 }
257257
258 pub fn change_token_property(258 pub fn set_token_property(
259 collection: &NonfungibleHandle<T>,259 collection: &NonfungibleHandle<T>,
260 sender: &T::CrossAccountId,260 sender: &T::CrossAccountId,
261 token_id: TokenId,261 token_id: TokenId,
292 }292 }
293293
294 <TokenProperties<T>>::try_mutate((collection.id, token_id), |properties| {294 <TokenProperties<T>>::try_mutate((collection.id, token_id), |properties| {
295 properties.try_change_property(property.clone())295 properties.try_set_property(property.clone())
296 })?;296 })?;
297297
298 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertySet(298 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertySet(
304 Ok(())304 Ok(())
305 }305 }
306306
307 pub fn change_token_properties(307 pub fn set_token_properties(
308 collection: &NonfungibleHandle<T>,308 collection: &NonfungibleHandle<T>,
309 sender: &T::CrossAccountId,309 sender: &T::CrossAccountId,
310 token_id: TokenId,310 token_id: TokenId,
311 properties: Vec<Property>,311 properties: Vec<Property>,
312 ) -> DispatchResult {312 ) -> DispatchResult {
313 for property in properties {313 for property in properties {
314 Self::change_token_property(collection, sender, token_id, property)?;314 Self::set_token_property(collection, sender, token_id, property)?;
315 }315 }
316316
317 Ok(())317 Ok(())
318 }318 }
319319
320 pub fn change_collection_properties(320 pub fn set_collection_properties(
321 collection: &NonfungibleHandle<T>,321 collection: &NonfungibleHandle<T>,
322 sender: &T::CrossAccountId,322 sender: &T::CrossAccountId,
323 properties: Vec<Property>,323 properties: Vec<Property>,
324 ) -> DispatchResult {324 ) -> DispatchResult {
325 <PalletCommon<T>>::change_collection_properties(collection, sender, properties)325 <PalletCommon<T>>::set_collection_properties(collection, sender, properties)
326 }326 }
327327
328 pub fn change_property_permissions(328 pub fn set_property_permissions(
329 collection: &CollectionHandle<T>,329 collection: &CollectionHandle<T>,
330 sender: &T::CrossAccountId,330 sender: &T::CrossAccountId,
331 property_permissions: Vec<PropertyKeyPermission>331 property_permissions: Vec<PropertyKeyPermission>
332 ) -> DispatchResult {332 ) -> DispatchResult {
333 <PalletCommon<T>>::change_property_permissions(333 <PalletCommon<T>>::set_property_permissions(
334 collection,334 collection,
335 sender,335 sender,
336 property_permissions,336 property_permissions,
modifiedpallets/nonfungible/src/weights.rsdiffbeforeafterboth
36 fn create_multiple_items(b: u32, ) -> Weight;36 fn create_multiple_items(b: u32, ) -> Weight;
37 fn create_multiple_items_ex(b: u32, ) -> Weight;37 fn create_multiple_items_ex(b: u32, ) -> Weight;
38 fn burn_item() -> Weight;38 fn burn_item() -> Weight;
39 fn change_collection_properties(amount: u32) -> Weight;39 fn set_collection_properties(amount: u32) -> Weight;
40 fn change_token_properties(amount: u32) -> Weight;40 fn set_token_properties(amount: u32) -> Weight;
41 fn change_property_permissions(amount: u32) -> Weight;41 fn set_property_permissions(amount: u32) -> Weight;
42 fn transfer() -> Weight;42 fn transfer() -> Weight;
43 fn approve() -> Weight;43 fn approve() -> Weight;
44 fn transfer_from() -> Weight;44 fn transfer_from() -> Weight;
94 .saturating_add(T::DbWeight::get().writes(4 as Weight))94 .saturating_add(T::DbWeight::get().writes(4 as Weight))
95 }95 }
9696
97 fn change_collection_properties(amount: u32) -> Weight {97 fn set_collection_properties(amount: u32) -> Weight {
98 // TODO calculate appropriate weight98 // TODO calculate appropriate weight
99 (50_000_000 as Weight).saturating_mul(amount as Weight)99 (50_000_000 as Weight).saturating_mul(amount as Weight)
100 }100 }
101101
102 fn change_token_properties(amount: u32) -> Weight {102 fn set_token_properties(amount: u32) -> Weight {
103 // TODO calculate appropriate weight103 // TODO calculate appropriate weight
104 (50_000_000 as Weight).saturating_mul(amount as Weight)104 (50_000_000 as Weight).saturating_mul(amount as Weight)
105 }105 }
106106
107 fn change_property_permissions(amount: u32) -> Weight {107 fn set_property_permissions(amount: u32) -> Weight {
108 // TODO calculate appropriate weight108 // TODO calculate appropriate weight
109 (50_000_000 as Weight).saturating_mul(amount as Weight)109 (50_000_000 as Weight).saturating_mul(amount as Weight)
110 }110 }
199 .saturating_add(RocksDbWeight::get().writes(4 as Weight))199 .saturating_add(RocksDbWeight::get().writes(4 as Weight))
200 }200 }
201201
202 fn change_collection_properties(amount: u32) -> Weight {202 fn set_collection_properties(amount: u32) -> Weight {
203 // TODO calculate appropriate weight203 // TODO calculate appropriate weight
204 (50_000_000 as Weight).saturating_mul(amount as Weight)204 (50_000_000 as Weight).saturating_mul(amount as Weight)
205 }205 }
206206
207 fn change_token_properties(amount: u32) -> Weight {207 fn set_token_properties(amount: u32) -> Weight {
208 // TODO calculate appropriate weight208 // TODO calculate appropriate weight
209 (50_000_000 as Weight).saturating_mul(amount as Weight)209 (50_000_000 as Weight).saturating_mul(amount as Weight)
210 }210 }
211211
212 fn change_property_permissions(amount: u32) -> Weight {212 fn set_property_permissions(amount: u32) -> Weight {
213 // TODO calculate appropriate weight213 // TODO calculate appropriate weight
214 (50_000_000 as Weight).saturating_mul(amount as Weight)214 (50_000_000 as Weight).saturating_mul(amount as Weight)
215 }215 }
modifiedpallets/refungible/src/common.rsdiffbeforeafterboth
66 max_weight_of!(burn_item_partial(), burn_item_fully())66 max_weight_of!(burn_item_partial(), burn_item_fully())
67 }67 }
6868
69 fn change_collection_properties(amount: u32) -> Weight {69 fn set_collection_properties(amount: u32) -> Weight {
70 <SelfWeightOf<T>>::change_collection_properties(amount)70 <SelfWeightOf<T>>::set_collection_properties(amount)
71 }71 }
7272
73 fn change_token_properties(amount: u32) -> Weight {73 fn set_token_properties(amount: u32) -> Weight {
74 <SelfWeightOf<T>>::change_token_properties(amount)74 <SelfWeightOf<T>>::set_token_properties(amount)
75 }75 }
7676
77 fn change_property_permissions(amount: u32) -> Weight {77 fn set_property_permissions(amount: u32) -> Weight {
78 <SelfWeightOf<T>>::change_property_permissions(amount)78 <SelfWeightOf<T>>::set_property_permissions(amount)
79 }79 }
8080
81 fn transfer() -> Weight {81 fn transfer() -> Weight {
256 )256 )
257 }257 }
258258
259 fn change_collection_properties(259 fn set_collection_properties(
260 &self,260 &self,
261 _sender: T::CrossAccountId,261 _sender: T::CrossAccountId,
262 _property: Vec<Property>,262 _property: Vec<Property>,
263 ) -> DispatchResultWithPostInfo {263 ) -> DispatchResultWithPostInfo {
264 fail!(<Error<T>>::PropertiesNotAllowed)264 fail!(<Error<T>>::PropertiesNotAllowed)
265 }265 }
266266
267 fn change_token_properties(267 fn set_token_properties(
268 &self,268 &self,
269 _sender: T::CrossAccountId,269 _sender: T::CrossAccountId,
270 _token_id: TokenId,270 _token_id: TokenId,
273 fail!(<Error<T>>::PropertiesNotAllowed)273 fail!(<Error<T>>::PropertiesNotAllowed)
274 }274 }
275275
276 fn change_property_permissions(276 fn set_property_permissions(
277 &self,277 &self,
278 _sender: &T::CrossAccountId,278 _sender: &T::CrossAccountId,
279 _property_permissions: Vec<PropertyKeyPermission>,279 _property_permissions: Vec<PropertyKeyPermission>,
modifiedpallets/refungible/src/weights.rsdiffbeforeafterboth
38 fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight;38 fn create_multiple_items_ex_multiple_owners(b: u32, ) -> Weight;
39 fn burn_item_partial() -> Weight;39 fn burn_item_partial() -> Weight;
40 fn burn_item_fully() -> Weight;40 fn burn_item_fully() -> Weight;
41 fn change_collection_properties(amount: u32) -> Weight;41 fn set_collection_properties(amount: u32) -> Weight;
42 fn change_token_properties(amount: u32) -> Weight;42 fn set_token_properties(amount: u32) -> Weight;
43 fn change_property_permissions(amount: u32) -> Weight;43 fn set_property_permissions(amount: u32) -> Weight;
44 fn transfer_normal() -> Weight;44 fn transfer_normal() -> Weight;
45 fn transfer_creating() -> Weight;45 fn transfer_creating() -> Weight;
46 fn transfer_removing() -> Weight;46 fn transfer_removing() -> Weight;
133 .saturating_add(T::DbWeight::get().writes(6 as Weight))133 .saturating_add(T::DbWeight::get().writes(6 as Weight))
134 }134 }
135135
136 fn change_collection_properties(amount: u32) -> Weight {136 fn set_collection_properties(amount: u32) -> Weight {
137 // Error137 // Error
138 0138 0
139 }139 }
140140
141 fn change_token_properties(amount: u32) -> Weight {141 fn set_token_properties(amount: u32) -> Weight {
142 // Error142 // Error
143 0143 0
144 }144 }
145145
146 fn change_property_permissions(amount: u32) -> Weight {146 fn set_property_permissions(amount: u32) -> Weight {
147 // Error147 // Error
148 0148 0
149 }149 }
317 .saturating_add(RocksDbWeight::get().writes(6 as Weight))317 .saturating_add(RocksDbWeight::get().writes(6 as Weight))
318 }318 }
319319
320 fn change_collection_properties(amount: u32) -> Weight {320 fn set_collection_properties(amount: u32) -> Weight {
321 // Error321 // Error
322 0322 0
323 }323 }
324324
325 fn change_token_properties(amount: u32) -> Weight {325 fn set_token_properties(amount: u32) -> Weight {
326 // Error326 // Error
327 0327 0
328 }328 }
329329
330 fn change_property_permissions(amount: u32) -> Weight {330 fn set_property_permissions(amount: u32) -> Weight {
331 // Error331 // Error
332 0332 0
333 }333 }
modifiedpallets/unique/src/lib.rsdiffbeforeafterboth
694 dispatch_call::<T, _>(collection_id, |d| d.create_multiple_items(sender, owner, items_data, &budget))694 dispatch_call::<T, _>(collection_id, |d| d.create_multiple_items(sender, owner, items_data, &budget))
695 }695 }
696696
697 #[weight = T::CommonWeightInfo::change_collection_properties(properties.len() as u32)]697 #[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)]
698 #[transactional]698 #[transactional]
699 pub fn change_collection_properties(699 pub fn set_collection_properties(
700 origin,700 origin,
701 collection_id: CollectionId,701 collection_id: CollectionId,
702 properties: Vec<Property>702 properties: Vec<Property>
705705
706 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);706 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
707707
708 dispatch_call::<T, _>(collection_id, |d| d.change_collection_properties(sender, properties))708 dispatch_call::<T, _>(collection_id, |d| d.set_collection_properties(sender, properties))
709 }709 }
710710
711 #[weight = T::CommonWeightInfo::change_token_properties(properties.len() as u32)]711 #[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)]
712 #[transactional]712 #[transactional]
713 pub fn change_token_properties(713 pub fn set_token_properties(
714 origin,714 origin,
715 collection_id: CollectionId,715 collection_id: CollectionId,
716 token_id: TokenId,716 token_id: TokenId,
720720
721 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);721 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
722722
723 dispatch_call::<T, _>(collection_id, |d| d.change_token_properties(sender, token_id, properties))723 dispatch_call::<T, _>(collection_id, |d| d.set_token_properties(sender, token_id, properties))
724 }724 }
725725
726 #[weight = T::CommonWeightInfo::change_property_permissions(property_permissions.len() as u32)]726 #[weight = T::CommonWeightInfo::set_property_permissions(property_permissions.len() as u32)]
727 #[transactional]727 #[transactional]
728 pub fn change_property_permissions(728 pub fn set_property_permissions(
729 origin,729 origin,
730 collection_id: CollectionId,730 collection_id: CollectionId,
731 property_permissions: Vec<PropertyKeyPermission>,731 property_permissions: Vec<PropertyKeyPermission>,
734734
735 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);735 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
736736
737 dispatch_call::<T, _>(collection_id, |d| d.change_property_permissions(&sender, property_permissions))737 dispatch_call::<T, _>(collection_id, |d| d.set_property_permissions(&sender, property_permissions))
738 }738 }
739739
740 #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)]740 #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)]
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
698 let mut props = Self::new(MAX_COLLECTION_PROPERTIES_SIZE);698 let mut props = Self::new(MAX_COLLECTION_PROPERTIES_SIZE);
699699
700 for property in data.into_iter() {700 for property in data.into_iter() {
701 props.try_change_property(property)?;701 props.try_set_property(property)?;
702 }702 }
703703
704 Ok(props)704 Ok(props)
705 }705 }
706706
707 pub fn try_change_property(&mut self, property: Property) -> Result<(), PropertiesError> {707 pub fn try_set_property(&mut self, property: Property) -> Result<(), PropertiesError> {
708 let value_len = property.value.len();708 let value_len = property.value.len();
709709
710 if self.consumed_space as usize + value_len > self.space_limit as usize {710 if self.consumed_space as usize + value_len > self.space_limit as usize {
741 }741 }
742}742}
743
744// #[cfg(not(feature = "std"))]
745// fn properties_map_debug(_properties: &PropertiesMap, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
746// write!(f, "<properties>")
747// }
748
749// #[cfg(not(feature = "std"))]
750// fn opt_properties_permissions_map_debug(properties: &Option<PropertiesPermissionMap>, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
751// if properties.is_some() {
752// write!(f, "Some(<properties permissions>)")
753// } else {
754// write!(f, "None")
755// }
756// }
757743
modifiedruntime/common/src/weights.rsdiffbeforeafterboth
54 dispatch_weight::<T>() + max_weight_of!(burn_item())54 dispatch_weight::<T>() + max_weight_of!(burn_item())
55 }55 }
5656
57 fn change_collection_properties(amount: u32) -> Weight {57 fn set_collection_properties(amount: u32) -> Weight {
58 dispatch_weight::<T>() + max_weight_of!(change_collection_properties(amount))58 dispatch_weight::<T>() + max_weight_of!(set_collection_properties(amount))
59 }59 }
6060
61 fn change_token_properties(amount: u32) -> Weight {61 fn set_token_properties(amount: u32) -> Weight {
62 dispatch_weight::<T>() + max_weight_of!(change_token_properties(amount))62 dispatch_weight::<T>() + max_weight_of!(set_token_properties(amount))
63 }63 }
6464
65 fn change_property_permissions(amount: u32) -> Weight {65 fn set_property_permissions(amount: u32) -> Weight {
66 dispatch_weight::<T>() + max_weight_of!(change_property_permissions(amount))66 dispatch_weight::<T>() + max_weight_of!(set_property_permissions(amount))
67 }67 }
6868
69 fn transfer() -> Weight {69 fn transfer() -> Weight {