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.rsdiffbeforeafterboth--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -18,7 +18,7 @@
use erc::ERC721Events;
use evm_coder::ToLog;
-use frame_support::{BoundedVec, ensure, fail};
+use frame_support::{BoundedVec, ensure, fail, transactional};
use up_data_structs::{
AccessMode, CollectionId, CustomDataLimit, TokenId, CreateCollectionData, CreateNftExData,
mapping::TokenAddressMapping, NestingRule, budget::Budget, Property, PropertyPermission,
@@ -307,6 +307,7 @@
Ok(())
}
+ #[transactional]
pub fn set_token_properties(
collection: &NonfungibleHandle<T>,
sender: &T::CrossAccountId,
@@ -390,6 +391,7 @@
}
}
+ #[transactional]
pub fn delete_token_properties(
collection: &NonfungibleHandle<T>,
sender: &T::CrossAccountId,