difftreelog
Rename property change to set
in: master
11 files changed
pallets/common/src/lib.rsdiffbeforeafterboth731 Ok(())731 Ok(())732 }732 }733733734 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,740740741 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 )?;745745746 Self::deposit_event(Event::CollectionPropertySet(collection.id, property));746 Self::deposit_event(Event::CollectionPropertySet(collection.id, property));747747748 Ok(())748 Ok(())749 }749 }750750751 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 }759759760 Ok(())760 Ok(())761 }761 }762762763 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: PropertyKeyPermission784 Ok(())784 Ok(())785 }785 }786786787 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 }795795796 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>,pallets/fungible/src/common.rsdiffbeforeafterboth50 <SelfWeightOf<T>>::burn_item()50 <SelfWeightOf<T>>::burn_item()51 }51 }525253 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 }565657 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 }606061 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 }646465 fn transfer() -> Weight {65 fn transfer() -> Weight {237 )237 )238 }238 }239239240 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 }247247248 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 }256256257 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>,pallets/fungible/src/weights.rsdiffbeforeafterboth35 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 }757576 fn change_collection_properties(amount: u32) -> Weight {76 fn set_collection_properties(amount: u32) -> Weight {77 // Error77 // Error78 078 079 }79 }808081 fn change_token_properties(amount: u32) -> Weight {81 fn set_token_properties(amount: u32) -> Weight {82 // Error82 // Error83 083 084 }84 }858586 fn change_property_permissions(amount: u32) -> Weight {86 fn set_property_permissions(amount: u32) -> Weight {87 // Error87 // Error88 088 089 }89 }146 .saturating_add(RocksDbWeight::get().writes(2 as Weight))146 .saturating_add(RocksDbWeight::get().writes(2 as Weight))147 }147 }148148149 fn change_collection_properties(amount: u32) -> Weight {149 fn set_collection_properties(amount: u32) -> Weight {150 // Error150 // Error151 0151 0152 }152 }153153154 fn change_token_properties(amount: u32) -> Weight {154 fn set_token_properties(amount: u32) -> Weight {155 // Error155 // Error156 0156 0157 }157 }158158159 fn change_property_permissions(amount: u32) -> Weight {159 fn set_property_permissions(amount: u32) -> Weight {160 // Error160 // Error161 0161 0162 }162 }pallets/nonfungible/src/common.rsdiffbeforeafterboth50 <SelfWeightOf<T>>::burn_item()50 <SelfWeightOf<T>>::burn_item()51 }51 }525253 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 }565657 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 }606061 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 }646465 fn transfer() -> Weight {65 fn transfer() -> Weight {153 )153 )154 }154 }155155156 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);162162163 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 weight166 )166 )167 }167 }168168169 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);176176177 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 weight180 )180 )181 }181 }182182183 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);189189190 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 weight193 )193 )194 }194 }pallets/nonfungible/src/lib.rsdiffbeforeafterboth255 Ok(())255 Ok(())256 }256 }257257258 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 }293293294 <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 })?;297297298 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertySet(298 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertySet(304 Ok(())304 Ok(())305 }305 }306306307 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 }316316317 Ok(())317 Ok(())318 }318 }319319320 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 }327327328 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,pallets/nonfungible/src/weights.rsdiffbeforeafterboth36 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 }969697 fn change_collection_properties(amount: u32) -> Weight {97 fn set_collection_properties(amount: u32) -> Weight {98 // TODO calculate appropriate weight98 // TODO calculate appropriate weight99 (50_000_000 as Weight).saturating_mul(amount as Weight)99 (50_000_000 as Weight).saturating_mul(amount as Weight)100 }100 }101101102 fn change_token_properties(amount: u32) -> Weight {102 fn set_token_properties(amount: u32) -> Weight {103 // TODO calculate appropriate weight103 // TODO calculate appropriate weight104 (50_000_000 as Weight).saturating_mul(amount as Weight)104 (50_000_000 as Weight).saturating_mul(amount as Weight)105 }105 }106106107 fn change_property_permissions(amount: u32) -> Weight {107 fn set_property_permissions(amount: u32) -> Weight {108 // TODO calculate appropriate weight108 // TODO calculate appropriate weight109 (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 }201201202 fn change_collection_properties(amount: u32) -> Weight {202 fn set_collection_properties(amount: u32) -> Weight {203 // TODO calculate appropriate weight203 // TODO calculate appropriate weight204 (50_000_000 as Weight).saturating_mul(amount as Weight)204 (50_000_000 as Weight).saturating_mul(amount as Weight)205 }205 }206206207 fn change_token_properties(amount: u32) -> Weight {207 fn set_token_properties(amount: u32) -> Weight {208 // TODO calculate appropriate weight208 // TODO calculate appropriate weight209 (50_000_000 as Weight).saturating_mul(amount as Weight)209 (50_000_000 as Weight).saturating_mul(amount as Weight)210 }210 }211211212 fn change_property_permissions(amount: u32) -> Weight {212 fn set_property_permissions(amount: u32) -> Weight {213 // TODO calculate appropriate weight213 // TODO calculate appropriate weight214 (50_000_000 as Weight).saturating_mul(amount as Weight)214 (50_000_000 as Weight).saturating_mul(amount as Weight)215 }215 }pallets/refungible/src/common.rsdiffbeforeafterboth66 max_weight_of!(burn_item_partial(), burn_item_fully())66 max_weight_of!(burn_item_partial(), burn_item_fully())67 }67 }686869 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 }727273 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 }767677 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 }808081 fn transfer() -> Weight {81 fn transfer() -> Weight {256 )256 )257 }257 }258258259 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 }266266267 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 }275275276 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>,pallets/refungible/src/weights.rsdiffbeforeafterboth38 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 }135135136 fn change_collection_properties(amount: u32) -> Weight {136 fn set_collection_properties(amount: u32) -> Weight {137 // Error137 // Error138 0138 0139 }139 }140140141 fn change_token_properties(amount: u32) -> Weight {141 fn set_token_properties(amount: u32) -> Weight {142 // Error142 // Error143 0143 0144 }144 }145145146 fn change_property_permissions(amount: u32) -> Weight {146 fn set_property_permissions(amount: u32) -> Weight {147 // Error147 // Error148 0148 0149 }149 }317 .saturating_add(RocksDbWeight::get().writes(6 as Weight))317 .saturating_add(RocksDbWeight::get().writes(6 as Weight))318 }318 }319319320 fn change_collection_properties(amount: u32) -> Weight {320 fn set_collection_properties(amount: u32) -> Weight {321 // Error321 // Error322 0322 0323 }323 }324324325 fn change_token_properties(amount: u32) -> Weight {325 fn set_token_properties(amount: u32) -> Weight {326 // Error326 // Error327 0327 0328 }328 }329329330 fn change_property_permissions(amount: u32) -> Weight {330 fn set_property_permissions(amount: u32) -> Weight {331 // Error331 // Error332 0332 0333 }333 }pallets/unique/src/lib.rsdiffbeforeafterboth694 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 }696696697 #[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>705705706 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);706 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);707707708 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 }710710711 #[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,720720721 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);721 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);722722723 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 }725725726 #[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>,734734735 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);735 let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);736736737 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 }739739740 #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)]740 #[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)]primitives/data-structs/src/lib.rsdiffbeforeafterboth698 let mut props = Self::new(MAX_COLLECTION_PROPERTIES_SIZE);698 let mut props = Self::new(MAX_COLLECTION_PROPERTIES_SIZE);699699700 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 }703703704 Ok(props)704 Ok(props)705 }705 }706706707 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();709709710 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}743744// #[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// }748749// #[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// }757743runtime/common/src/weights.rsdiffbeforeafterboth54 dispatch_weight::<T>() + max_weight_of!(burn_item())54 dispatch_weight::<T>() + max_weight_of!(burn_item())55 }55 }565657 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 }606061 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 }646465 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 }686869 fn transfer() -> Weight {69 fn transfer() -> Weight {