difftreelog
refactor remove unneeded fn, add transactional attrs
in: master
2 files changed
pallets/common/src/lib.rsdiffbeforeafterboth26 traits::{Imbalance, Get, Currency, WithdrawReasons, ExistenceRequirement},26 traits::{Imbalance, Get, Currency, WithdrawReasons, ExistenceRequirement},27 BoundedVec,27 BoundedVec,28 weights::Pays,28 weights::Pays,29 transactional,29};30};30use pallet_evm::GasWeightMapping;31use pallet_evm::GasWeightMapping;31use up_data_structs::{32use up_data_structs::{742 Ok(())743 Ok(())743 }744 }744745746 #[transactional]745 pub fn set_collection_properties(747 pub fn set_collection_properties(746 collection: &CollectionHandle<T>,748 collection: &CollectionHandle<T>,747 sender: &T::CrossAccountId,749 sender: &T::CrossAccountId,774 Ok(())776 Ok(())775 }777 }776778779 #[transactional]777 pub fn delete_collection_properties(780 pub fn delete_collection_properties(778 collection: &CollectionHandle<T>,781 collection: &CollectionHandle<T>,779 sender: &T::CrossAccountId,782 sender: &T::CrossAccountId,816 Ok(())819 Ok(())817 }820 }818821822 #[transactional]819 pub fn set_property_permissions(823 pub fn set_property_permissions(820 collection: &CollectionHandle<T>,824 collection: &CollectionHandle<T>,821 sender: &T::CrossAccountId,825 sender: &T::CrossAccountId,839 .collect::<Result<Vec<PropertyKey>, DispatchError>>()843 .collect::<Result<Vec<PropertyKey>, DispatchError>>()840 }844 }841842 pub fn check_property_key(key: &PropertyKey) -> Result<(), DispatchError> {843 let key_str = sp_std::str::from_utf8(key.as_slice())844 .map_err(|_| <Error<T>>::InvalidCharacterInPropertyKey)?;845846 for ch in key_str.chars() {847 if !ch.is_ascii_alphanumeric() && ch != '_' && ch != '-' {848 return Err(<Error<T>>::InvalidCharacterInPropertyKey.into());849 }850 }851852 Ok(())853 }854845855 pub fn filter_collection_properties(846 pub fn filter_collection_properties(856 collection_id: CollectionId,847 collection_id: CollectionId,pallets/nonfungible/src/lib.rsdiffbeforeafterboth181819use erc::ERC721Events;19use erc::ERC721Events;20use evm_coder::ToLog;20use evm_coder::ToLog;21use frame_support::{BoundedVec, ensure, fail};21use frame_support::{BoundedVec, ensure, fail, transactional};22use up_data_structs::{22use up_data_structs::{23 AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,23 AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,24 mapping::TokenAddressMapping, NestingRule, budget::Budget, Property, PropertyPermission,24 mapping::TokenAddressMapping, NestingRule, budget::Budget, Property, PropertyPermission,307 Ok(())307 Ok(())308 }308 }309309310 #[transactional]310 pub fn set_token_properties(311 pub fn set_token_properties(311 collection: &NonfungibleHandle<T>,312 collection: &NonfungibleHandle<T>,312 sender: &T::CrossAccountId,313 sender: &T::CrossAccountId,390 }391 }391 }392 }392393394 #[transactional]393 pub fn delete_token_properties(395 pub fn delete_token_properties(394 collection: &NonfungibleHandle<T>,396 collection: &NonfungibleHandle<T>,395 sender: &T::CrossAccountId,397 sender: &T::CrossAccountId,