git.delta.rocks / unique-network / refs/commits / 7fd36cea2f6e

difftreelog

refactor remove `#[transactional]` from extrinsics

Yaroslav Bolyukin2022-07-21parent: #e198017.patch.diff
in: master
Every extrinsic now runs in transaction implicitly, and
`#[transactional]` on pallet dispatchable is now meaningless

4 files changed

modifiedpallets/evm-migration/src/lib.rsdiffbeforeafterboth
before · pallets/evm-migration/src/lib.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#![cfg_attr(not(feature = "std"), no_std)]1819pub use pallet::*;20#[cfg(feature = "runtime-benchmarks")]21pub mod benchmarking;22pub mod weights;2324#[frame_support::pallet]25pub mod pallet {26	use frame_support::{pallet_prelude::*, transactional};27	use frame_system::pallet_prelude::*;28	use sp_core::{H160, H256};29	use sp_std::vec::Vec;30	use super::weights::WeightInfo;31	use pallet_evm::{PrecompileHandle, Pallet as PalletEvm};3233	#[pallet::config]34	pub trait Config: frame_system::Config + pallet_evm::Config {35		type WeightInfo: WeightInfo;36	}3738	type SelfWeightOf<T> = <T as Config>::WeightInfo;3940	#[pallet::pallet]41	#[pallet::generate_store(pub(super) trait Store)]42	pub struct Pallet<T>(_);4344	#[pallet::error]45	pub enum Error<T> {46		AccountNotEmpty,47		AccountIsNotMigrating,48	}4950	#[pallet::storage]51	pub(super) type MigrationPending<T: Config> =52		StorageMap<Hasher = Twox64Concat, Key = H160, Value = bool, QueryKind = ValueQuery>;5354	#[pallet::call]55	impl<T: Config> Pallet<T> {56		#[pallet::weight(<SelfWeightOf<T>>::begin())]57		pub fn begin(origin: OriginFor<T>, address: H160) -> DispatchResult {58			ensure_root(origin)?;59			ensure!(60				<PalletEvm<T>>::is_account_empty(&address) && !<MigrationPending<T>>::get(&address),61				<Error<T>>::AccountNotEmpty,62			);6364			<MigrationPending<T>>::insert(address, true);65			Ok(())66		}6768		#[pallet::weight(<SelfWeightOf<T>>::set_data(data.len() as u32))]69		pub fn set_data(70			origin: OriginFor<T>,71			address: H160,72			data: Vec<(H256, H256)>,73		) -> DispatchResult {74			ensure_root(origin)?;75			ensure!(76				<MigrationPending<T>>::get(&address),77				<Error<T>>::AccountIsNotMigrating,78			);7980			for (k, v) in data {81				<pallet_evm::AccountStorages<T>>::insert(&address, k, v);82			}83			Ok(())84		}8586		#[pallet::weight(<SelfWeightOf<T>>::finish(code.len() as u32))]87		#[transactional]88		pub fn finish(origin: OriginFor<T>, address: H160, code: Vec<u8>) -> DispatchResult {89			ensure_root(origin)?;90			ensure!(91				<MigrationPending<T>>::get(&address),92				<Error<T>>::AccountIsNotMigrating,93			);9495			<pallet_evm::AccountCodes<T>>::insert(&address, code);96			<MigrationPending<T>>::remove(address);97			Ok(())98		}99	}100101	pub struct OnMethodCall<T>(PhantomData<T>);102	impl<T: Config> pallet_evm::OnMethodCall<T> for OnMethodCall<T> {103		fn is_reserved(contract: &H160) -> bool {104			<MigrationPending<T>>::get(&contract)105		}106107		fn is_used(_contract: &H160) -> bool {108			false109		}110111		fn call(_handle: &mut impl PrecompileHandle) -> Option<pallet_evm::PrecompileResult> {112			None113		}114115		fn get_code(_contract: &H160) -> Option<Vec<u8>> {116			None117		}118	}119}
after · pallets/evm-migration/src/lib.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#![cfg_attr(not(feature = "std"), no_std)]1819pub use pallet::*;20#[cfg(feature = "runtime-benchmarks")]21pub mod benchmarking;22pub mod weights;2324#[frame_support::pallet]25pub mod pallet {26	use frame_support::pallet_prelude::*;27	use frame_system::pallet_prelude::*;28	use sp_core::{H160, H256};29	use sp_std::vec::Vec;30	use super::weights::WeightInfo;31	use pallet_evm::{PrecompileHandle, Pallet as PalletEvm};3233	#[pallet::config]34	pub trait Config: frame_system::Config + pallet_evm::Config {35		type WeightInfo: WeightInfo;36	}3738	type SelfWeightOf<T> = <T as Config>::WeightInfo;3940	#[pallet::pallet]41	#[pallet::generate_store(pub(super) trait Store)]42	pub struct Pallet<T>(_);4344	#[pallet::error]45	pub enum Error<T> {46		AccountNotEmpty,47		AccountIsNotMigrating,48	}4950	#[pallet::storage]51	pub(super) type MigrationPending<T: Config> =52		StorageMap<Hasher = Twox64Concat, Key = H160, Value = bool, QueryKind = ValueQuery>;5354	#[pallet::call]55	impl<T: Config> Pallet<T> {56		#[pallet::weight(<SelfWeightOf<T>>::begin())]57		pub fn begin(origin: OriginFor<T>, address: H160) -> DispatchResult {58			ensure_root(origin)?;59			ensure!(60				<PalletEvm<T>>::is_account_empty(&address) && !<MigrationPending<T>>::get(&address),61				<Error<T>>::AccountNotEmpty,62			);6364			<MigrationPending<T>>::insert(address, true);65			Ok(())66		}6768		#[pallet::weight(<SelfWeightOf<T>>::set_data(data.len() as u32))]69		pub fn set_data(70			origin: OriginFor<T>,71			address: H160,72			data: Vec<(H256, H256)>,73		) -> DispatchResult {74			ensure_root(origin)?;75			ensure!(76				<MigrationPending<T>>::get(&address),77				<Error<T>>::AccountIsNotMigrating,78			);7980			for (k, v) in data {81				<pallet_evm::AccountStorages<T>>::insert(&address, k, v);82			}83			Ok(())84		}8586		#[pallet::weight(<SelfWeightOf<T>>::finish(code.len() as u32))]87		pub fn finish(origin: OriginFor<T>, address: H160, code: Vec<u8>) -> DispatchResult {88			ensure_root(origin)?;89			ensure!(90				<MigrationPending<T>>::get(&address),91				<Error<T>>::AccountIsNotMigrating,92			);9394			<pallet_evm::AccountCodes<T>>::insert(&address, code);95			<MigrationPending<T>>::remove(address);96			Ok(())97		}98	}99100	pub struct OnMethodCall<T>(PhantomData<T>);101	impl<T: Config> pallet_evm::OnMethodCall<T> for OnMethodCall<T> {102		fn is_reserved(contract: &H160) -> bool {103			<MigrationPending<T>>::get(&contract)104		}105106		fn is_used(_contract: &H160) -> bool {107			false108		}109110		fn call(_handle: &mut impl PrecompileHandle) -> Option<pallet_evm::PrecompileResult> {111			None112		}113114		fn get_code(_contract: &H160) -> Option<Vec<u8>> {115			None116		}117	}118}
modifiedpallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth
--- a/pallets/proxy-rmrk-core/src/lib.rs
+++ b/pallets/proxy-rmrk-core/src/lib.rs
@@ -145,7 +145,7 @@
 
 #![cfg_attr(not(feature = "std"), no_std)]
 
-use frame_support::{pallet_prelude::*, transactional, BoundedVec, dispatch::DispatchResult};
+use frame_support::{pallet_prelude::*, BoundedVec, dispatch::DispatchResult};
 use frame_system::{pallet_prelude::*, ensure_signed};
 use sp_runtime::{DispatchError, Permill, traits::StaticLookup};
 use sp_std::{
@@ -350,11 +350,11 @@
 		/// * Anyone - will be assigned as the issuer of the collection.
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `metadata`: Metadata describing the collection, e.g. IPFS hash. Cannot be changed.
 		/// - `max`: Optional maximum number of tokens.
 		/// - `symbol`: UTF-8 string with token prefix, by which to represent the token in wallets and UIs.
 		/// Analogous to Unique's [`token_prefix`](up_data_structs::Collection). Cannot be changed.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::create_collection())]
 		pub fn create_collection(
 			origin: OriginFor<T>,
@@ -426,8 +426,8 @@
 		/// * Collection issuer
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `collection_id`: RMRK ID of the collection to destroy.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::destroy_collection())]
 		pub fn destroy_collection(
 			origin: OriginFor<T>,
@@ -459,9 +459,9 @@
 		/// * Collection issuer
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `collection_id`: RMRK collection ID to change the issuer of.
 		/// - `new_issuer`: Collection's new issuer.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::change_collection_issuer())]
 		pub fn change_collection_issuer(
 			origin: OriginFor<T>,
@@ -497,8 +497,8 @@
 		/// * Collection issuer
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `collection_id`: RMRK ID of the collection to lock.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::lock_collection())]
 		pub fn lock_collection(
 			origin: OriginFor<T>,
@@ -535,6 +535,7 @@
 		/// * Collection issuer
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `owner`: Owner account of the NFT. If set to None, defaults to the sender (collection issuer).
 		/// - `collection_id`: RMRK collection ID for the NFT to be minted within. Cannot be changed.
 		/// - `recipient`: Receiver account of the royalty. Has no effect if the `royalty_amount` is not set. Cannot be changed.
@@ -542,7 +543,6 @@
 		/// - `metadata`: Arbitrary data about an NFT, e.g. IPFS hash. Cannot be changed.
 		/// - `transferable`: Can this NFT be transferred? Cannot be changed.
 		/// - `resources`: Resource data to be added to the NFT immediately after minting.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::mint_nft(resources.as_ref().map(|r| r.len() as u32).unwrap_or(0)))]
 		pub fn mint_nft(
 			origin: OriginFor<T>,
@@ -620,12 +620,12 @@
 		/// * Token owner
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `collection_id`: RMRK ID of the collection in which the NFT to burn belongs to.
 		/// - `nft_id`: ID of the NFT to be destroyed.
 		/// - `max_burns`: Maximum number of tokens to burn, assuming nesting. The transaction
 		/// is reverted if there are more tokens to burn in the nesting tree than this number.
 		/// This is primarily a mechanism of transaction weight control.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::burn_nft(*max_burns))]
 		pub fn burn_nft(
 			origin: OriginFor<T>,
@@ -669,10 +669,10 @@
 		/// - Token owner
 		///
 		/// # Arguments:
-		/// - `collection_id`: RMRK ID of the collection of the NFT to be transferred.
-		/// - `nft_id`: ID of the NFT to be transferred.
+		/// - `origin`: sender of the transaction
+		/// - `rmrk_collection_id`: RMRK ID of the collection of the NFT to be transferred.
+		/// - `rmrk_nft_id`: ID of the NFT to be transferred.
 		/// - `new_owner`: New owner of the nft which can be either an account or a NFT.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::send())]
 		pub fn send(
 			origin: OriginFor<T>,
@@ -793,11 +793,11 @@
 		/// - Token-owner-to-be
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `rmrk_collection_id`: RMRK collection ID of the NFT to be accepted.
 		/// - `rmrk_nft_id`: ID of the NFT to be accepted.
 		/// - `new_owner`: Either the sender's account ID or a sender-owned NFT,
 		/// whichever the accepted NFT was sent to.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::accept_nft())]
 		pub fn accept_nft(
 			origin: OriginFor<T>,
@@ -885,9 +885,9 @@
 		/// - Token-owner-to-be-not
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `rmrk_collection_id`: RMRK ID of the NFT to be rejected.
 		/// - `rmrk_nft_id`: ID of the NFT to be rejected.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::reject_nft())]
 		pub fn reject_nft(
 			origin: OriginFor<T>,
@@ -950,10 +950,11 @@
 		/// - Token owner
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `rmrk_collection_id`: RMRK collection ID of the NFT.
 		/// - `rmrk_nft_id`: ID of the NFT with a pending resource to be accepted.
 		/// - `resource_id`: ID of the newly created pending resource.
-		#[transactional]
+		/// accept the addition of a new resource to an existing NFT
 		#[pallet::weight(<SelfWeightOf<T>>::accept_resource())]
 		pub fn accept_resource(
 			origin: OriginFor<T>,
@@ -1004,10 +1005,10 @@
 		/// - Token owner
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `rmrk_collection_id`: RMRK collection ID of the NFT.
 		/// - `rmrk_nft_id`: ID of the NFT with a resource to be removed.
 		/// - `resource_id`: ID of the removal-pending resource.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::accept_resource_removal())]
 		pub fn accept_resource_removal(
 			origin: OriginFor<T>,
@@ -1084,11 +1085,11 @@
 		/// - Token owner - in case of NFT property
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `rmrk_collection_id`: RMRK collection ID.
 		/// - `maybe_nft_id`: Optional ID of the NFT. If left empty, then the property is set for the collection.
 		/// - `key`: Key of the custom property to be referenced by.
 		/// - `value`: Value of the custom property to be stored.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::set_property())]
 		pub fn set_property(
 			origin: OriginFor<T>,
@@ -1158,10 +1159,10 @@
 		/// - Token owner
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `rmrk_collection_id`: RMRK collection ID of the NFT.
 		/// - `rmrk_nft_id`: ID of the NFT to rearrange resource priorities for.
 		/// - `priorities`: Ordered vector of resource IDs.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::set_priority())]
 		pub fn set_priority(
 			origin: OriginFor<T>,
@@ -1209,10 +1210,10 @@
 		/// the owner's [acceptance](Pallet::accept_resource).
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `rmrk_collection_id`: RMRK collection ID of the NFT.
 		/// - `nft_id`: ID of the NFT to assign a resource to.
 		/// - `resource`: Data of the resource to be created.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::add_basic_resource())]
 		pub fn add_basic_resource(
 			origin: OriginFor<T>,
@@ -1251,10 +1252,10 @@
 		/// the owner's [acceptance](Pallet::accept_resource).
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `rmrk_collection_id`: RMRK collection ID of the NFT.
 		/// - `nft_id`: ID of the NFT to assign a resource to.
 		/// - `resource`: Data of the resource to be created.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::add_composable_resource())]
 		pub fn add_composable_resource(
 			origin: OriginFor<T>,
@@ -1313,10 +1314,10 @@
 		/// the owner's [acceptance](Pallet::accept_resource).
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `rmrk_collection_id`: RMRK collection ID of the NFT.
 		/// - `nft_id`: ID of the NFT to assign a resource to.
 		/// - `resource`: Data of the resource to be created.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::add_slot_resource())]
 		pub fn add_slot_resource(
 			origin: OriginFor<T>,
@@ -1354,10 +1355,10 @@
 		/// - Collection issuer
 		///
 		/// # Arguments
-		/// - `collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to.
+		/// - `origin`: sender of the transaction
+		/// - `rmrk_collection_id`: RMRK ID of a collection to which the NFT making use of the resource belongs to.
 		/// - `nft_id`: ID of the NFT with a resource to be removed.
 		/// - `resource_id`: ID of the resource to be removed.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::remove_resource())]
 		pub fn remove_resource(
 			origin: OriginFor<T>,
modifiedpallets/proxy-rmrk-equip/src/lib.rsdiffbeforeafterboth
--- a/pallets/proxy-rmrk-equip/src/lib.rs
+++ b/pallets/proxy-rmrk-equip/src/lib.rs
@@ -133,7 +133,7 @@
 
 #![cfg_attr(not(feature = "std"), no_std)]
 
-use frame_support::{pallet_prelude::*, transactional, BoundedVec, dispatch::DispatchResult};
+use frame_support::{pallet_prelude::*, BoundedVec, dispatch::DispatchResult};
 use frame_system::{pallet_prelude::*, ensure_signed};
 use sp_runtime::DispatchError;
 use up_data_structs::*;
@@ -226,11 +226,11 @@
 		/// - Anyone - will be assigned as the issuer of the Base.
 		///
 		/// # Arguments:
+		/// - `origin`: Caller, will be assigned as the issuer of the Base
 		/// - `base_type`: Arbitrary media type, e.g. "svg".
 		/// - `symbol`: Arbitrary client-chosen symbol.
 		/// - `parts`: Array of Fixed and Slot Parts composing the Base,
 		/// confined in length by [`RmrkPartsLimit`](up_data_structs::RmrkPartsLimit).
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::create_base(parts.len() as u32))]
 		pub fn create_base(
 			origin: OriginFor<T>,
@@ -295,13 +295,13 @@
 		/// - Base issuer
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `base_id`: Base ID containing the Theme to be updated.
 		/// - `theme`: Theme to add to the Base.  A Theme has a name and properties, which are an
 		///   array of [key, value, inherit].
 		///   - `key`: Arbitrary BoundedString, defined by client.
 		///   - `value`: Arbitrary BoundedString, defined by client.
 		///   - `inherit`: Optional bool.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::theme_add(theme.properties.len() as u32))]
 		pub fn theme_add(
 			origin: OriginFor<T>,
@@ -359,10 +359,10 @@
 		/// - Base issuer
 		///
 		/// # Arguments:
+		/// - `origin`: sender of the transaction
 		/// - `base_id`: Base containing the Slot Part to be updated.
-		/// - `part_id`: Slot Part whose Equippable List is being updated.
+		/// - `slot_id`: Slot Part whose Equippable List is being updated .
 		/// - `equippables`: List of equippables that will override the current Equippables list.
-		#[transactional]
 		#[pallet::weight(<SelfWeightOf<T>>::equippable())]
 		pub fn equippable(
 			origin: OriginFor<T>,
modifiedpallets/unique/src/lib.rsdiffbeforeafterboth
--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -78,7 +78,6 @@
 	dispatch::DispatchResult,
 	ensure, fail,
 	weights::{Weight},
-	transactional,
 	pallet_prelude::{DispatchResultWithPostInfo, ConstU32},
 	BoundedVec,
 };
@@ -311,7 +310,6 @@
 		/// * `mode`: Type of items stored in the collection and type dependent data.
 		// returns collection ID
 		#[weight = <SelfWeightOf<T>>::create_collection()]
-		#[transactional]
 		#[deprecated(note = "`create_collection_ex` is more up-to-date and advanced, prefer it instead")]
 		pub fn create_collection(
 			origin,
@@ -342,7 +340,6 @@
 		///
 		/// * `data`: Explicit data of a collection used for its creation.
 		#[weight = <SelfWeightOf<T>>::create_collection()]
-		#[transactional]
 		pub fn create_collection_ex(origin, data: CreateCollectionData<T::AccountId>) -> DispatchResult {
 			let sender = ensure_signed(origin)?;
 
@@ -363,7 +360,6 @@
 		///
 		/// * `collection_id`: Collection to destroy.
 		#[weight = <SelfWeightOf<T>>::destroy_collection()]
-		#[transactional]
 		pub fn destroy_collection(origin, collection_id: CollectionId) -> DispatchResult {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 			let collection = <CollectionHandle<T>>::try_get(collection_id)?;
@@ -399,7 +395,6 @@
 		/// * `collection_id`: ID of the modified collection.
 		/// * `address`: ID of the address to be added to the allowlist.
 		#[weight = <SelfWeightOf<T>>::add_to_allow_list()]
-		#[transactional]
 		pub fn add_to_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
 
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
@@ -433,7 +428,6 @@
 		/// * `collection_id`: ID of the modified collection.
 		/// * `address`: ID of the address to be removed from the allowlist.
 		#[weight = <SelfWeightOf<T>>::remove_from_allow_list()]
-		#[transactional]
 		pub fn remove_from_allow_list(origin, collection_id: CollectionId, address: T::CrossAccountId) -> DispatchResult{
 
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
@@ -466,7 +460,6 @@
 		/// * `collection_id`: ID of the modified collection.
 		/// * `new_owner`: ID of the account that will become the owner.
 		#[weight = <SelfWeightOf<T>>::change_collection_owner()]
-		#[transactional]
 		pub fn change_collection_owner(origin, collection_id: CollectionId, new_owner: T::AccountId) -> DispatchResult {
 
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
@@ -501,8 +494,7 @@
 		/// * `collection_id`: ID of the Collection to add an admin for.
 		/// * `new_admin`: Address of new admin to add.
 		#[weight = <SelfWeightOf<T>>::add_collection_admin()]
-		#[transactional]
-		pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin: T::CrossAccountId) -> DispatchResult {
+		pub fn add_collection_admin(origin, collection_id: CollectionId, new_admin_id: T::CrossAccountId) -> DispatchResult {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 			let collection = <CollectionHandle<T>>::try_get(collection_id)?;
 			collection.check_is_internal()?;
@@ -530,7 +522,6 @@
 		/// * `collection_id`: ID of the collection to remove the admin for.
 		/// * `account_id`: Address of the admin to remove.
 		#[weight = <SelfWeightOf<T>>::remove_collection_admin()]
-		#[transactional]
 		pub fn remove_collection_admin(origin, collection_id: CollectionId, account_id: T::CrossAccountId) -> DispatchResult {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 			let collection = <CollectionHandle<T>>::try_get(collection_id)?;
@@ -558,7 +549,6 @@
 		/// * `collection_id`: ID of the modified collection.
 		/// * `new_sponsor`: ID of the account of the sponsor-to-be.
 		#[weight = <SelfWeightOf<T>>::set_collection_sponsor()]
-		#[transactional]
 		pub fn set_collection_sponsor(origin, collection_id: CollectionId, new_sponsor: T::AccountId) -> DispatchResult {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 
@@ -590,7 +580,6 @@
 		///
 		/// * `collection_id`: ID of the collection with the pending sponsor.
 		#[weight = <SelfWeightOf<T>>::confirm_sponsorship()]
-		#[transactional]
 		pub fn confirm_sponsorship(origin, collection_id: CollectionId) -> DispatchResult {
 			let sender = ensure_signed(origin)?;
 
@@ -619,7 +608,6 @@
 		///
 		/// * `collection_id`: ID of the collection with the sponsor to remove.
 		#[weight = <SelfWeightOf<T>>::remove_collection_sponsor()]
-		#[transactional]
 		pub fn remove_collection_sponsor(origin, collection_id: CollectionId) -> DispatchResult {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 
@@ -654,7 +642,6 @@
 		/// * `owner`: Address of the initial owner of the item.
 		/// * `data`: Token data describing the item to store on chain.
 		#[weight = T::CommonWeightInfo::create_item()]
-		#[transactional]
 		pub fn create_item(origin, collection_id: CollectionId, owner: T::CrossAccountId, data: CreateItemData) -> DispatchResultWithPostInfo {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 			let budget = budget::Value::new(NESTING_BUDGET);
@@ -681,7 +668,6 @@
 		/// * `owner`: Address of the initial owner of the tokens.
 		/// * `items_data`: Vector of data describing each item to be created.
 		#[weight = T::CommonWeightInfo::create_multiple_items(&items_data)]
-		#[transactional]
 		pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResultWithPostInfo {
 			ensure!(!items_data.is_empty(), Error::<T>::EmptyArgument);
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
@@ -703,7 +689,6 @@
 		/// * `properties`: Vector of key-value pairs stored as the collection's metadata.
 		/// Keys support Latin letters, `-`, `_`, and `.` as symbols.
 		#[weight = T::CommonWeightInfo::set_collection_properties(properties.len() as u32)]
-		#[transactional]
 		pub fn set_collection_properties(
 			origin,
 			collection_id: CollectionId,
@@ -729,7 +714,6 @@
 		/// * `property_keys`: Vector of keys of the properties to be deleted.
 		/// Keys support Latin letters, `-`, `_`, and `.` as symbols.
 		#[weight = T::CommonWeightInfo::delete_collection_properties(property_keys.len() as u32)]
-		#[transactional]
 		pub fn delete_collection_properties(
 			origin,
 			collection_id: CollectionId,
@@ -761,7 +745,6 @@
 		/// * `properties`: Vector of key-value pairs stored as the token's metadata.
 		/// Keys support Latin letters, `-`, `_`, and `.` as symbols.
 		#[weight = T::CommonWeightInfo::set_token_properties(properties.len() as u32)]
-		#[transactional]
 		pub fn set_token_properties(
 			origin,
 			collection_id: CollectionId,
@@ -792,7 +775,6 @@
 		/// * `property_keys`: Vector of keys of the properties to be deleted.
 		/// Keys support Latin letters, `-`, `_`, and `.` as symbols.
 		#[weight = T::CommonWeightInfo::delete_token_properties(property_keys.len() as u32)]
-		#[transactional]
 		pub fn delete_token_properties(
 			origin,
 			collection_id: CollectionId,
@@ -823,7 +805,6 @@
 		/// * `property_permissions`: Vector of permissions for property keys.
 		/// Keys support Latin letters, `-`, `_`, and `.` as symbols.
 		#[weight = T::CommonWeightInfo::set_token_property_permissions(property_permissions.len() as u32)]
-		#[transactional]
 		pub fn set_token_property_permissions(
 			origin,
 			collection_id: CollectionId,
@@ -852,7 +833,6 @@
 		/// * `collection_id`: ID of the collection to which the tokens would belong.
 		/// * `data`: Explicit item creation data.
 		#[weight = T::CommonWeightInfo::create_multiple_items_ex(&data)]
-		#[transactional]
 		pub fn create_multiple_items_ex(origin, collection_id: CollectionId, data: CreateItemExData<T::CrossAccountId>) -> DispatchResultWithPostInfo {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 			let budget = budget::Value::new(NESTING_BUDGET);
@@ -871,7 +851,6 @@
 		/// * `collection_id`: ID of the collection.
 		/// * `value`: New value of the flag, are transfers allowed?
 		#[weight = <SelfWeightOf<T>>::set_transfers_enabled_flag()]
-		#[transactional]
 		pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 			let mut target_collection = <CollectionHandle<T>>::try_get(collection_id)?;
@@ -901,7 +880,6 @@
 		///     * Fungible Mode: The desired number of pieces to burn.
 		///     * Re-Fungible Mode: The desired number of pieces to burn.
 		#[weight = T::CommonWeightInfo::burn_item()]
-		#[transactional]
 		pub fn burn_item(origin, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 
@@ -940,7 +918,6 @@
 		///     * Fungible Mode: The desired number of pieces to burn.
 		///     * Re-Fungible Mode: The desired number of pieces to burn.
 		#[weight = T::CommonWeightInfo::burn_from()]
-		#[transactional]
 		pub fn burn_from(origin, collection_id: CollectionId, from: T::CrossAccountId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 			let budget = budget::Value::new(NESTING_BUDGET);
@@ -970,7 +947,6 @@
 		///     * Fungible Mode: The desired number of pieces to transfer.
 		///     * Re-Fungible Mode: The desired number of pieces to transfer.
 		#[weight = T::CommonWeightInfo::transfer()]
-		#[transactional]
 		pub fn transfer(origin, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128) -> DispatchResultWithPostInfo {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 			let budget = budget::Value::new(NESTING_BUDGET);
@@ -994,7 +970,6 @@
 		/// * `amount`: Number of pieces of the item approved for a transaction (maximum of 1 for NFTs).
 		/// Set to 0 to revoke the approval.
 		#[weight = T::CommonWeightInfo::approve()]
-		#[transactional]
 		pub fn approve(origin, spender: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, amount: u128) -> DispatchResultWithPostInfo {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 
@@ -1026,7 +1001,6 @@
 		///     * Fungible Mode: The desired number of pieces to transfer.
 		///     * Re-Fungible Mode: The desired number of pieces to transfer.
 		#[weight = T::CommonWeightInfo::transfer_from()]
-		#[transactional]
 		pub fn transfer_from(origin, from: T::CrossAccountId, recipient: T::CrossAccountId, collection_id: CollectionId, item_id: TokenId, value: u128 ) -> DispatchResultWithPostInfo {
 			let sender = T::CrossAccountId::from_sub(ensure_signed(origin)?);
 			let budget = budget::Value::new(NESTING_BUDGET);
@@ -1047,7 +1021,6 @@
 		/// * `new_limit`: New limits of the collection. Fields that are not set (None)
 		/// will not overwrite the old ones.
 		#[weight = <SelfWeightOf<T>>::set_collection_limits()]
-		#[transactional]
 		pub fn set_collection_limits(
 			origin,
 			collection_id: CollectionId,
@@ -1081,7 +1054,6 @@
 		/// * `new_permission`: New permissions of the collection. Fields that are not set (None)
 		/// will not overwrite the old ones.
 		#[weight = <SelfWeightOf<T>>::set_collection_limits()]
-		#[transactional]
 		pub fn set_collection_permissions(
 			origin,
 			collection_id: CollectionId,
@@ -1114,7 +1086,6 @@
 		/// * `token_id`: ID of the RFT.
 		/// * `amount`: New number of parts/pieces into which the token shall be partitioned.
 		#[weight = T::RefungibleExtensionsWeightInfo::repartition()]
-		#[transactional]
 		pub fn repartition(
 			origin,
 			collection_id: CollectionId,