difftreelog
Merge branch 'develop' into feature/docker-base-img
in: master
11 files changed
pallets/common/src/benchmarking.rsdiffbeforeafterboth176 key: property_key(p as usize),176 key: property_key(p as usize),177 value: property_value(),177 value: property_value(),178 }).collect::<Vec<_>>();178 }).collect::<Vec<_>>();179 }: {<Pallet<T>>::set_collection_properties(&collection, &owner, props)?}179 }: {<Pallet<T>>::set_collection_properties(&collection, &owner, props.into_iter())?}180180181 delete_collection_properties {181 delete_collection_properties {182 let b in 0..MAX_PROPERTIES_PER_ITEM;182 let b in 0..MAX_PROPERTIES_PER_ITEM;188 key: property_key(p as usize),188 key: property_key(p as usize),189 value: property_value(),189 value: property_value(),190 }).collect::<Vec<_>>();190 }).collect::<Vec<_>>();191 <Pallet<T>>::set_collection_properties(&collection, &owner, props)?;191 <Pallet<T>>::set_collection_properties(&collection, &owner, props.into_iter())?;192 let to_delete = (0..b).map(|p| property_key(p as usize)).collect::<Vec<_>>();192 let to_delete = (0..b).map(|p| property_key(p as usize)).collect::<Vec<_>>();193 }: {<Pallet<T>>::delete_collection_properties(&collection, &owner, to_delete)?}193 }: {<Pallet<T>>::delete_collection_properties(&collection, &owner, to_delete.into_iter())?}194}194}195195pallets/common/src/erc.rsdiffbeforeafterboth125 .map(eth::Property::try_into)125 .map(eth::Property::try_into)126 .collect::<Result<Vec<_>>>()?;126 .collect::<Result<Vec<_>>>()?;127127128 <Pallet<T>>::set_collection_properties(self, &caller, properties)128 <Pallet<T>>::set_collection_properties(self, &caller, properties.into_iter())129 .map_err(dispatch_to_evm::<T>)129 .map_err(dispatch_to_evm::<T>)130 }130 }131131158 })158 })159 .collect::<Result<Vec<_>>>()?;159 .collect::<Result<Vec<_>>>()?;160160161 <Pallet<T>>::delete_collection_properties(self, &caller, keys).map_err(dispatch_to_evm::<T>)161 <Pallet<T>>::delete_collection_properties(self, &caller, keys.into_iter())162 .map_err(dispatch_to_evm::<T>)162 }163 }163164pallets/common/src/lib.rsdiffbeforeafterboth1198 Ok(())1198 Ok(())1199 }1199 }120012001201 /// Set collection property.1201 /// This function sets or removes a collection properties according to1202 /// `properties_updates` contents:1203 /// * sets a property under the <key> with the value provided `(<key>, Some(<value>))`1204 /// * removes a property under the <key> if the value is `None` `(<key>, None)`.1202 ///1205 ///1203 /// * `collection` - Collection handler.1206 /// This function fires an event for each property change.1204 /// * `sender` - The owner or administrator of the collection.1207 /// In case of an error, all the changes (including the events) will be reverted1205 /// * `property` - The property to set.1208 /// since the function is transactional.1209 #[transactional]1206 pub fn set_collection_property(1210 fn modify_collection_properties(1207 collection: &CollectionHandle<T>,1211 collection: &CollectionHandle<T>,1208 sender: &T::CrossAccountId,1212 sender: &T::CrossAccountId,1209 property: Property,1213 properties_updates: impl Iterator<Item = (PropertyKey, Option<PropertyValue>)>,1210 ) -> DispatchResult {1214 ) -> DispatchResult {1211 collection.check_is_owner_or_admin(sender)?;1215 collection.check_is_owner_or_admin(sender)?;121212161213 CollectionProperties::<T>::try_mutate(collection.id, |properties| {1217 let mut stored_properties = <CollectionProperties<T>>::get(collection.id);1214 let property = property.clone();12181215 properties.try_set(property.key, property.value)1219 for (key, value) in properties_updates {1216 })1220 match value {1217 .map_err(<Error<T>>::from)?;1221 Some(value) => {12181222 stored_properties1223 .try_set(key.clone(), value)1219 Self::deposit_event(Event::CollectionPropertySet(collection.id, property.key));1224 .map_err(<Error<T>>::from)?;12251226 Self::deposit_event(Event::CollectionPropertySet(collection.id, key));1220 <PalletEvm<T>>::deposit_log(1227 <PalletEvm<T>>::deposit_log(1221 erc::CollectionHelpersEvents::CollectionChanged {1228 erc::CollectionHelpersEvents::CollectionChanged {1222 collection_id: eth::collection_id_to_address(collection.id),1229 collection_id: eth::collection_id_to_address(collection.id),1223 }1230 }1224 .to_log(T::ContractAddress::get()),1231 .to_log(T::ContractAddress::get()),1225 );1232 );1233 }1234 None => {1235 stored_properties.remove(&key).map_err(<Error<T>>::from)?;12361237 Self::deposit_event(Event::CollectionPropertyDeleted(collection.id, key));1238 <PalletEvm<T>>::deposit_log(1239 erc::CollectionHelpersEvents::CollectionChanged {1240 collection_id: eth::collection_id_to_address(collection.id),1241 }1242 .to_log(T::ContractAddress::get()),1243 );1244 }1245 }1246 }12471248 <CollectionProperties<T>>::set(collection.id, stored_properties);122612491227 Ok(())1250 Ok(())1228 }1251 }12521253 /// Set collection property.1254 ///1255 /// * `collection` - Collection handler.1256 /// * `sender` - The owner or administrator of the collection.1257 /// * `property` - The property to set.1258 pub fn set_collection_property(1259 collection: &CollectionHandle<T>,1260 sender: &T::CrossAccountId,1261 property: Property,1262 ) -> DispatchResult {1263 Self::set_collection_properties(collection, sender, [property].into_iter())1264 }122912651230 /// Set a scoped collection property, where the scope is a special prefix1266 /// Set a scoped collection property, where the scope is a special prefix1231 /// prohibiting a user access to change the property directly.1267 /// prohibiting a user access to change the property directly.1270 /// * `collection` - Collection handler.1306 /// * `collection` - Collection handler.1271 /// * `sender` - The owner or administrator of the collection.1307 /// * `sender` - The owner or administrator of the collection.1272 /// * `properties` - The properties to set.1308 /// * `properties` - The properties to set.1273 #[transactional]1274 pub fn set_collection_properties(1309 pub fn set_collection_properties(1275 collection: &CollectionHandle<T>,1310 collection: &CollectionHandle<T>,1276 sender: &T::CrossAccountId,1311 sender: &T::CrossAccountId,1277 properties: Vec<Property>,1312 properties: impl Iterator<Item = Property>,1278 ) -> DispatchResult {1313 ) -> DispatchResult {1279 for property in properties {1280 Self::set_collection_property(collection, sender, property)?;1314 Self::modify_collection_properties(1281 }1315 collection,12821316 sender,1283 Ok(())1317 properties.map(|property| (property.key, Some(property.value))),1318 )1284 }1319 }128513201293 sender: &T::CrossAccountId,1328 sender: &T::CrossAccountId,1294 property_key: PropertyKey,1329 property_key: PropertyKey,1295 ) -> DispatchResult {1330 ) -> DispatchResult {1296 collection.check_is_owner_or_admin(sender)?;12971298 CollectionProperties::<T>::try_mutate(collection.id, |properties| {1299 properties.remove(&property_key)1300 })1301 .map_err(<Error<T>>::from)?;13021303 Self::deposit_event(Event::CollectionPropertyDeleted(1304 collection.id,1305 property_key,1306 ));1307 <PalletEvm<T>>::deposit_log(1331 Self::delete_collection_properties(collection, sender, [property_key].into_iter())1308 erc::CollectionHelpersEvents::CollectionChanged {1309 collection_id: eth::collection_id_to_address(collection.id),1310 }1311 .to_log(T::ContractAddress::get()),1312 );13131314 Ok(())1315 }1332 }131613331317 /// Delete collection properties.1334 /// Delete collection properties.1318 ///1335 ///1319 /// * `collection` - Collection handler.1336 /// * `collection` - Collection handler.1320 /// * `sender` - The owner or administrator of the collection.1337 /// * `sender` - The owner or administrator of the collection.1321 /// * `properties` - The properties to delete.1338 /// * `properties` - The properties to delete.1322 #[transactional]1323 pub fn delete_collection_properties(1339 pub fn delete_collection_properties(1324 collection: &CollectionHandle<T>,1340 collection: &CollectionHandle<T>,1325 sender: &T::CrossAccountId,1341 sender: &T::CrossAccountId,1326 property_keys: Vec<PropertyKey>,1342 property_keys: impl Iterator<Item = PropertyKey>,1327 ) -> DispatchResult {1343 ) -> DispatchResult {1328 for key in property_keys {1329 Self::delete_collection_property(collection, sender, key)?;1344 Self::modify_collection_properties(collection, sender, property_keys.map(|key| (key, None)))1330 }13311332 Ok(())1333 }1345 }133413461335 /// Set collection propetry permission without any checks.1347 /// Set collection propetry permission without any checks.pallets/fungible/src/lib.rsdiffbeforeafterboth266 sender: &T::CrossAccountId,266 sender: &T::CrossAccountId,267 properties: Vec<Property>,267 properties: Vec<Property>,268 ) -> DispatchResult {268 ) -> DispatchResult {269 <PalletCommon<T>>::set_collection_properties(collection, sender, properties)269 <PalletCommon<T>>::set_collection_properties(collection, sender, properties.into_iter())270 }270 }271271272 /// Delete properties of the collection, associated with the provided keys.272 /// Delete properties of the collection, associated with the provided keys.278 <PalletCommon<T>>::delete_collection_properties(collection, sender, property_keys)278 <PalletCommon<T>>::delete_collection_properties(279 collection,280 sender,281 property_keys.into_iter(),282 )279 }283 }280284pallets/nonfungible/src/lib.rsdiffbeforeafterboth577 })577 })578 }578 }579579580 /// Batch operation to add, edit or remove properties for the token580 /// A batch operation to add, edit or remove properties for a token.581 ///581 /// It sets or removes a token's properties according to582 /// All affected properties should have mutable permission and sender should have582 /// `properties_updates` contents:583 /// permission to edit those properties.583 /// * sets a property under the <key> with the value provided `(<key>, Some(<value>))`584 /// * removes a property under the <key> if the value is `None` `(<key>, None)`.584 ///585 ///585 /// - `nesting_budget`: Limit for searching parents in depth to check ownership.586 /// - `nesting_budget`: Limit for searching parents in-depth to check ownership.586 /// - `is_token_create`: Indicates that method is called during token initialization.587 /// - `is_token_create`: Indicates that method is called during token initialization.587 /// Allows to bypass ownership check.588 /// Allows to bypass ownership check.589 ///590 /// All affected properties should have `mutable` permission591 /// to be **deleted** or to be **set more than once**,592 /// and the sender should have permission to edit those properties.593 ///594 /// This function fires an event for each property change.595 /// In case of an error, all the changes (including the events) will be reverted596 /// since the function is transactional.588 #[transactional]597 #[transactional]589 fn modify_token_properties(598 fn modify_token_properties(590 collection: &NonfungibleHandle<T>,599 collection: &NonfungibleHandle<T>,591 sender: &T::CrossAccountId,600 sender: &T::CrossAccountId,592 token_id: TokenId,601 token_id: TokenId,593 properties: impl Iterator<Item = (PropertyKey, Option<PropertyValue>)>,602 properties_updates: impl Iterator<Item = (PropertyKey, Option<PropertyValue>)>,594 is_token_create: bool,603 is_token_create: bool,595 nesting_budget: &dyn Budget,604 nesting_budget: &dyn Budget,596 ) -> DispatchResult {605 ) -> DispatchResult {614 })623 })615 };624 };625626 let mut stored_properties = <TokenProperties<T>>::get((collection.id, token_id));627 let permissions = <PalletCommon<T>>::property_permissions(collection.id);616628617 for (key, value) in properties {629 for (key, value) in properties_updates {618 let permission = <PalletCommon<T>>::property_permissions(collection.id)630 let permission = permissions619 .get(&key)631 .get(&key)620 .cloned()632 .cloned()621 .unwrap_or_else(PropertyPermission::none);633 .unwrap_or_else(PropertyPermission::none);622634623 let is_property_exists = TokenProperties::<T>::get((collection.id, token_id))635 let is_property_exists = stored_properties.get(&key).is_some();624 .get(&key)625 .is_some();626636649659650 match value {660 match value {651 Some(value) => {661 Some(value) => {652 <TokenProperties<T>>::try_mutate((collection.id, token_id), |properties| {662 stored_properties653 properties.try_set(key.clone(), value)663 .try_set(key.clone(), value)654 })655 .map_err(<CommonError<T>>::from)?;664 .map_err(<CommonError<T>>::from)?;656665657 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertySet(666 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertySet(661 ));670 ));662 }671 }663 None => {672 None => {664 <TokenProperties<T>>::try_mutate((collection.id, token_id), |properties| {673 stored_properties665 properties.remove(&key)674 .remove(&key)666 })667 .map_err(<CommonError<T>>::from)?;675 .map_err(<CommonError<T>>::from)?;668676669 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertyDeleted(677 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertyDeleted(683 );691 );684 }692 }693694 <TokenProperties<T>>::set((collection.id, token_id), stored_properties);685695686 Ok(())696 Ok(())687 }697 }784 sender: &T::CrossAccountId,794 sender: &T::CrossAccountId,785 properties: Vec<Property>,795 properties: Vec<Property>,786 ) -> DispatchResult {796 ) -> DispatchResult {787 <PalletCommon<T>>::set_collection_properties(collection, sender, properties)797 <PalletCommon<T>>::set_collection_properties(collection, sender, properties.into_iter())788 }798 }789799790 /// Remove properties from the collection800 /// Remove properties from the collection796 <PalletCommon<T>>::delete_collection_properties(collection, sender, property_keys)806 <PalletCommon<T>>::delete_collection_properties(807 collection,808 sender,809 property_keys.into_iter(),810 )797 }811 }798812pallets/nonfungible/src/weights.rsdiffbeforeafterboth184 .saturating_add(T::DbWeight::get().reads(1 as u64))184 .saturating_add(T::DbWeight::get().reads(1 as u64))185 .saturating_add(T::DbWeight::get().writes(1 as u64))185 .saturating_add(T::DbWeight::get().writes(1 as u64))186 }186 }187 // Storage: Common CollectionPropertyPermissions (r:1 w:0)188 // Storage: Nonfungible TokenProperties (r:1 w:1)187 // Storage: Nonfungible TokenProperties (r:1 w:1)188 // Storage: Common CollectionPropertyPermissions (r:1 w:0)189 fn set_token_properties(b: u32, ) -> Weight {189 fn set_token_properties(b: u32, ) -> Weight {190 Weight::from_ref_time(4_361_000 as u64)190 Weight::from_ref_time(31_850_484 as u64)191 // Standard Error: 5_349_868191 // Standard Error: 9_618192 .saturating_add(Weight::from_ref_time(637_246_356 as u64).saturating_mul(b as u64))192 .saturating_add(Weight::from_ref_time(4_721_947 as u64).saturating_mul(b as u64))193 .saturating_add(T::DbWeight::get().reads(2 as u64))193 .saturating_add(T::DbWeight::get().reads(2 as u64))194 .saturating_add(T::DbWeight::get().writes(1 as u64))194 .saturating_add(T::DbWeight::get().writes(1 as u64))195 }195 }196 // Storage: Common CollectionPropertyPermissions (r:1 w:0)197 // Storage: Nonfungible TokenProperties (r:1 w:1)196 // Storage: Nonfungible TokenProperties (r:1 w:1)197 // Storage: Common CollectionPropertyPermissions (r:1 w:0)198 fn delete_token_properties(b: u32, ) -> Weight {198 fn delete_token_properties(b: u32, ) -> Weight {199 Weight::from_ref_time(4_489_000 as u64)199 Weight::from_ref_time(13_795_000 as u64)200 // Standard Error: 5_738_954200 // Standard Error: 28_239201 .saturating_add(Weight::from_ref_time(689_912_822 as u64).saturating_mul(b as u64))201 .saturating_add(Weight::from_ref_time(12_840_446 as u64).saturating_mul(b as u64))202 .saturating_add(T::DbWeight::get().reads(2 as u64))202 .saturating_add(T::DbWeight::get().reads(2 as u64))203 .saturating_add(T::DbWeight::get().writes(1 as u64))203 .saturating_add(T::DbWeight::get().writes(1 as u64))204 }204 }354 .saturating_add(RocksDbWeight::get().reads(1 as u64))354 .saturating_add(RocksDbWeight::get().reads(1 as u64))355 .saturating_add(RocksDbWeight::get().writes(1 as u64))355 .saturating_add(RocksDbWeight::get().writes(1 as u64))356 }356 }357 // Storage: Common CollectionPropertyPermissions (r:1 w:0)358 // Storage: Nonfungible TokenProperties (r:1 w:1)357 // Storage: Nonfungible TokenProperties (r:1 w:1)358 // Storage: Common CollectionPropertyPermissions (r:1 w:0)359 fn set_token_properties(b: u32, ) -> Weight {359 fn set_token_properties(b: u32, ) -> Weight {360 Weight::from_ref_time(4_361_000 as u64)360 Weight::from_ref_time(31_850_484 as u64)361 // Standard Error: 5_349_868361 // Standard Error: 9_618362 .saturating_add(Weight::from_ref_time(637_246_356 as u64).saturating_mul(b as u64))362 .saturating_add(Weight::from_ref_time(4_721_947 as u64).saturating_mul(b as u64))363 .saturating_add(RocksDbWeight::get().reads(2 as u64))363 .saturating_add(RocksDbWeight::get().reads(2 as u64))364 .saturating_add(RocksDbWeight::get().writes(1 as u64))364 .saturating_add(RocksDbWeight::get().writes(1 as u64))365 }365 }366 // Storage: Common CollectionPropertyPermissions (r:1 w:0)367 // Storage: Nonfungible TokenProperties (r:1 w:1)366 // Storage: Nonfungible TokenProperties (r:1 w:1)367 // Storage: Common CollectionPropertyPermissions (r:1 w:0)368 fn delete_token_properties(b: u32, ) -> Weight {368 fn delete_token_properties(b: u32, ) -> Weight {369 Weight::from_ref_time(4_489_000 as u64)369 Weight::from_ref_time(13_795_000 as u64)370 // Standard Error: 5_738_954370 // Standard Error: 28_239371 .saturating_add(Weight::from_ref_time(689_912_822 as u64).saturating_mul(b as u64))371 .saturating_add(Weight::from_ref_time(12_840_446 as u64).saturating_mul(b as u64))372 .saturating_add(RocksDbWeight::get().reads(2 as u64))372 .saturating_add(RocksDbWeight::get().reads(2 as u64))373 .saturating_add(RocksDbWeight::get().writes(1 as u64))373 .saturating_add(RocksDbWeight::get().writes(1 as u64))374 }374 }pallets/refungible/src/lib.rsdiffbeforeafterboth515 Ok(())515 Ok(())516 }516 }517517518 /// A batch operation to add, edit or remove properties for a token.519 /// It sets or removes a token's properties according to520 /// `properties_updates` contents:521 /// * sets a property under the <key> with the value provided `(<key>, Some(<value>))`522 /// * removes a property under the <key> if the value is `None` `(<key>, None)`.523 ///524 /// - `nesting_budget`: Limit for searching parents in-depth to check ownership.525 /// - `is_token_create`: Indicates that method is called during token initialization.526 /// Allows to bypass ownership check.527 ///528 /// All affected properties should have `mutable` permission529 /// to be **deleted** or to be **set more than once**,530 /// and the sender should have permission to edit those properties.531 ///532 /// This function fires an event for each property change.533 /// In case of an error, all the changes (including the events) will be reverted534 /// since the function is transactional.518 #[transactional]535 #[transactional]519 fn modify_token_properties(536 fn modify_token_properties(520 collection: &RefungibleHandle<T>,537 collection: &RefungibleHandle<T>,521 sender: &T::CrossAccountId,538 sender: &T::CrossAccountId,522 token_id: TokenId,539 token_id: TokenId,523 properties: impl Iterator<Item = (PropertyKey, Option<PropertyValue>)>,540 properties_updates: impl Iterator<Item = (PropertyKey, Option<PropertyValue>)>,524 is_token_create: bool,541 is_token_create: bool,525 nesting_budget: &dyn Budget,542 nesting_budget: &dyn Budget,526 ) -> DispatchResult {543 ) -> DispatchResult {544 Ok(is_bundle_owner)561 Ok(is_bundle_owner)545 };562 };563564 let mut stored_properties = <TokenProperties<T>>::get((collection.id, token_id));565 let permissions = <PalletCommon<T>>::property_permissions(collection.id);546566547 for (key, value) in properties {567 for (key, value) in properties_updates {548 let permission = <PalletCommon<T>>::property_permissions(collection.id)568 let permission = permissions549 .get(&key)569 .get(&key)550 .cloned()570 .cloned()551 .unwrap_or_else(PropertyPermission::none);571 .unwrap_or_else(PropertyPermission::none);552572553 let is_property_exists = TokenProperties::<T>::get((collection.id, token_id))573 let is_property_exists = stored_properties.get(&key).is_some();554 .get(&key)555 .is_some();556574578596579 match value {597 match value {580 Some(value) => {598 Some(value) => {581 <TokenProperties<T>>::try_mutate((collection.id, token_id), |properties| {599 stored_properties582 properties.try_set(key.clone(), value)600 .try_set(key.clone(), value)583 })584 .map_err(<CommonError<T>>::from)?;601 .map_err(<CommonError<T>>::from)?;585602586 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertySet(603 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertySet(590 ));607 ));591 }608 }592 None => {609 None => {593 <TokenProperties<T>>::try_mutate((collection.id, token_id), |properties| {610 stored_properties594 properties.remove(&key)611 .remove(&key)595 })596 .map_err(<CommonError<T>>::from)?;612 .map_err(<CommonError<T>>::from)?;597613598 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertyDeleted(614 <PalletCommon<T>>::deposit_event(CommonEvent::TokenPropertyDeleted(612 );628 );613 }629 }630631 <TokenProperties<T>>::set((collection.id, token_id), stored_properties);614632615 Ok(())633 Ok(())616 }634 }1353 sender: &T::CrossAccountId,1371 sender: &T::CrossAccountId,1354 properties: Vec<Property>,1372 properties: Vec<Property>,1355 ) -> DispatchResult {1373 ) -> DispatchResult {1356 <PalletCommon<T>>::set_collection_properties(collection, sender, properties)1374 <PalletCommon<T>>::set_collection_properties(collection, sender, properties.into_iter())1357 }1375 }135813761359 pub fn delete_collection_properties(1377 pub fn delete_collection_properties(1364 <PalletCommon<T>>::delete_collection_properties(collection, sender, property_keys)1382 <PalletCommon<T>>::delete_collection_properties(1383 collection,1384 sender,1385 property_keys.into_iter(),1386 )1365 }1387 }13661388pallets/refungible/src/weights.rsdiffbeforeafterboth246 .saturating_add(T::DbWeight::get().reads(1 as u64))246 .saturating_add(T::DbWeight::get().reads(1 as u64))247 .saturating_add(T::DbWeight::get().writes(1 as u64))247 .saturating_add(T::DbWeight::get().writes(1 as u64))248 }248 }249 // Storage: Common CollectionPropertyPermissions (r:1 w:0)250 // Storage: Refungible TokenProperties (r:1 w:1)249 // Storage: Refungible TokenProperties (r:1 w:1)250 // Storage: Common CollectionPropertyPermissions (r:1 w:0)251 fn set_token_properties(b: u32, ) -> Weight {251 fn set_token_properties(b: u32, ) -> Weight {252 Weight::from_ref_time(4_578_000 as u64)252 Weight::from_ref_time(25_518_267 as u64)253 // Standard Error: 5_396_287253 // Standard Error: 20_451254 .saturating_add(Weight::from_ref_time(633_314_546 as u64).saturating_mul(b as u64))254 .saturating_add(Weight::from_ref_time(5_041_089 as u64).saturating_mul(b as u64))255 .saturating_add(T::DbWeight::get().reads(2 as u64))255 .saturating_add(T::DbWeight::get().reads(2 as u64))256 .saturating_add(T::DbWeight::get().writes(1 as u64))256 .saturating_add(T::DbWeight::get().writes(1 as u64))257 }257 }258 // Storage: Common CollectionPropertyPermissions (r:1 w:0)259 // Storage: Refungible TokenProperties (r:1 w:1)258 // Storage: Refungible TokenProperties (r:1 w:1)259 // Storage: Common CollectionPropertyPermissions (r:1 w:0)260 fn delete_token_properties(b: u32, ) -> Weight {260 fn delete_token_properties(b: u32, ) -> Weight {261 Weight::from_ref_time(4_583_000 as u64)261 Weight::from_ref_time(13_715_000 as u64)262 // Standard Error: 5_762_380262 // Standard Error: 28_323263 .saturating_add(Weight::from_ref_time(696_007_076 as u64).saturating_mul(b as u64))263 .saturating_add(Weight::from_ref_time(13_113_351 as u64).saturating_mul(b as u64))264 .saturating_add(T::DbWeight::get().reads(2 as u64))264 .saturating_add(T::DbWeight::get().reads(2 as u64))265 .saturating_add(T::DbWeight::get().writes(1 as u64))265 .saturating_add(T::DbWeight::get().writes(1 as u64))266 }266 }478 .saturating_add(RocksDbWeight::get().reads(1 as u64))478 .saturating_add(RocksDbWeight::get().reads(1 as u64))479 .saturating_add(RocksDbWeight::get().writes(1 as u64))479 .saturating_add(RocksDbWeight::get().writes(1 as u64))480 }480 }481 // Storage: Common CollectionPropertyPermissions (r:1 w:0)482 // Storage: Refungible TokenProperties (r:1 w:1)481 // Storage: Refungible TokenProperties (r:1 w:1)482 // Storage: Common CollectionPropertyPermissions (r:1 w:0)483 fn set_token_properties(b: u32, ) -> Weight {483 fn set_token_properties(b: u32, ) -> Weight {484 Weight::from_ref_time(4_578_000 as u64)484 Weight::from_ref_time(25_518_267 as u64)485 // Standard Error: 5_396_287485 // Standard Error: 20_451486 .saturating_add(Weight::from_ref_time(633_314_546 as u64).saturating_mul(b as u64))486 .saturating_add(Weight::from_ref_time(5_041_089 as u64).saturating_mul(b as u64))487 .saturating_add(RocksDbWeight::get().reads(2 as u64))487 .saturating_add(RocksDbWeight::get().reads(2 as u64))488 .saturating_add(RocksDbWeight::get().writes(1 as u64))488 .saturating_add(RocksDbWeight::get().writes(1 as u64))489 }489 }490 // Storage: Common CollectionPropertyPermissions (r:1 w:0)491 // Storage: Refungible TokenProperties (r:1 w:1)490 // Storage: Refungible TokenProperties (r:1 w:1)491 // Storage: Common CollectionPropertyPermissions (r:1 w:0)492 fn delete_token_properties(b: u32, ) -> Weight {492 fn delete_token_properties(b: u32, ) -> Weight {493 Weight::from_ref_time(4_583_000 as u64)493 Weight::from_ref_time(13_715_000 as u64)494 // Standard Error: 5_762_380494 // Standard Error: 28_323495 .saturating_add(Weight::from_ref_time(696_007_076 as u64).saturating_mul(b as u64))495 .saturating_add(Weight::from_ref_time(13_113_351 as u64).saturating_mul(b as u64))496 .saturating_add(RocksDbWeight::get().reads(2 as u64))496 .saturating_add(RocksDbWeight::get().reads(2 as u64))497 .saturating_add(RocksDbWeight::get().writes(1 as u64))497 .saturating_add(RocksDbWeight::get().writes(1 as u64))498 }498 }pallets/unique/src/eth/mod.rsdiffbeforeafterboth33};33};34use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult};34use pallet_evm::{account::CrossAccountId, OnMethodCall, PrecompileHandle, PrecompileResult};35use pallet_evm_coder_substrate::{dispatch_to_evm, SubstrateRecorder, WithRecorder};35use pallet_evm_coder_substrate::{dispatch_to_evm, SubstrateRecorder, WithRecorder};36use sp_std::vec;37use up_data_structs::{36use up_data_structs::{38 CollectionDescription, CollectionMode, CollectionName, CollectionTokenPrefix,37 CollectionDescription, CollectionMode, CollectionName, CollectionTokenPrefix,39 CreateCollectionData,38 CreateCollectionData,316 <PalletCommon<T>>::set_collection_properties(315 <PalletCommon<T>>::set_collection_properties(317 &collection,316 &collection,318 &caller,317 &caller,319 vec![up_data_structs::Property {318 [up_data_structs::Property {320 key: key::base_uri(),319 key: key::base_uri(),321 value: base_uri320 value: base_uri322 .into_bytes()321 .into_bytes()323 .try_into()322 .try_into()324 .map_err(|_| "base uri is too large")?,323 .map_err(|_| "base uri is too large")?,325 }],324 }]325 .into_iter(),326 )326 )327 .map_err(dispatch_to_evm::<T>)?;327 .map_err(dispatch_to_evm::<T>)?;328 }328 }runtime/common/identity.rsdiffbeforeafterboth24 transaction_validity::{TransactionValidity, ValidTransaction, TransactionValidityError},24 transaction_validity::{TransactionValidity, ValidTransaction, TransactionValidityError},25};25};2627#[cfg(feature = "collator-selection")]28use sp_runtime::transaction_validity::InvalidTransaction;262927#[derive(Debug, Encode, Decode, PartialEq, Eq, Clone, TypeInfo)]30#[derive(Debug, Encode, Decode, PartialEq, Eq, Clone, TypeInfo)]28pub struct DisableIdentityCalls;31pub struct DisableIdentityCalls;tests/src/util/playgrounds/unique.tsdiffbeforeafterboth651 try {651 try {652 result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), options, extrinsic) as ITransactionResult;652 result = await this.signTransaction(sender, this.constructApiCall(extrinsic, params), options, extrinsic) as ITransactionResult;653 events = this.eventHelper.extractEvents(result.result.events);653 events = this.eventHelper.extractEvents(result.result.events);654 const errorEvent = events.find((event) => event.method == 'ExecutedFailed' || event.method == 'CreatedFailed');655 if (errorEvent)656 throw Error(errorEvent.method + ': ' + extrinsic);654 }657 }655 catch(e) {658 catch(e) {656 if(!(e as object).hasOwnProperty('status')) throw e;659 if(!(e as object).hasOwnProperty('status')) throw e;