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

difftreelog

fmt

Trubnikov Sergey2022-07-15parent: #263bc69.patch.diff
in: master

3 files changed

modifiedpallets/common/src/dispatch.rsdiffbeforeafterboth
--- a/pallets/common/src/dispatch.rs
+++ b/pallets/common/src/dispatch.rs
@@ -23,7 +23,7 @@
 }
 
 /// Helper function to implement substrate calls for common collection methods.
-/// 
+///
 /// * `collection` - The collection on which to call the method.
 /// * `call` - The function in which to call the corresponding method from [CommonCollectionOperations].
 pub fn dispatch_tx<
@@ -72,7 +72,7 @@
 /// Interface for working with different collections through the dispatcher.
 pub trait CollectionDispatch<T: Config> {
 	/// Create a collection. The collection will be created according to the value of [data.mode](CreateCollectionData::mode).
-	/// 
+	///
 	/// * `sender` - The user who will become the owner of the collection.
 	/// * `data` - Description of the created collection.
 	fn create(
@@ -81,13 +81,13 @@
 	) -> DispatchResult;
 
 	/// Delete the collection.
-	/// 
+	///
 	/// * `sender` - The owner of the collection.
 	/// * `handle` - Collection handle.
 	fn destroy(sender: T::CrossAccountId, handle: CollectionHandle<T>) -> DispatchResult;
 
 	/// Get a specialized collection from the handle.
-	/// 
+	///
 	/// * `handle` - Collection handle.
 	fn dispatch(handle: CollectionHandle<T>) -> Self;
 
modifiedpallets/common/src/erc.rsdiffbeforeafterboth
61 T::AccountId: From<[u8; 32]>,61 T::AccountId: From<[u8; 32]>,
62{62{
63 /// Set collection property.63 /// Set collection property.
64 /// 64 ///
65 /// @param key Property key.65 /// @param key Property key.
66 /// @param value Propery value.66 /// @param value Propery value.
67 fn set_collection_property(67 fn set_collection_property(
81 }81 }
82 82
83 /// Delete collection property.83 /// Delete collection property.
84 /// 84 ///
85 /// @param key Property key.85 /// @param key Property key.
86 fn delete_collection_property(&mut self, caller: caller, key: string) -> Result<()> {86 fn delete_collection_property(&mut self, caller: caller, key: string) -> Result<()> {
87 let caller = T::CrossAccountId::from_eth(caller);87 let caller = T::CrossAccountId::from_eth(caller);
93 }93 }
9494
95 /// Get collection property.95 /// Get collection property.
96 /// 96 ///
97 /// @dev Throws error if key not found.97 /// @dev Throws error if key not found.
98 /// 98 ///
99 /// @param key Property key.99 /// @param key Property key.
100 /// @return bytes The property corresponding to the key.100 /// @return bytes The property corresponding to the key.
101 fn collection_property(&self, key: string) -> Result<bytes> {101 fn collection_property(&self, key: string) -> Result<bytes> {
110 }110 }
111111
112 /// Set the sponsor of the collection.112 /// Set the sponsor of the collection.
113 /// 113 ///
114 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.114 /// @dev In order for sponsorship to work, it must be confirmed on behalf of the sponsor.
115 /// 115 ///
116 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.116 /// @param sponsor Address of the sponsor from whose account funds will be debited for operations with the contract.
117 fn set_collection_sponsor(&mut self, caller: caller, sponsor: address) -> Result<void> {117 fn set_collection_sponsor(&mut self, caller: caller, sponsor: address) -> Result<void> {
118 check_is_owner_or_admin(caller, self)?;118 check_is_owner_or_admin(caller, self)?;
124 }124 }
125125
126 /// Collection sponsorship confirmation.126 /// Collection sponsorship confirmation.
127 /// 127 ///
128 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.128 /// @dev After setting the sponsor for the collection, it must be confirmed with this function.
129 fn confirm_collection_sponsorship(&mut self, caller: caller) -> Result<void> {129 fn confirm_collection_sponsorship(&mut self, caller: caller) -> Result<void> {
130 let caller = T::CrossAccountId::from_eth(caller);130 let caller = T::CrossAccountId::from_eth(caller);
261 }256 }
262257
263 /// Remove collection admin.258 /// Remove collection admin.
264 /// 259 ///
265 /// @param new_admin Address of the removed administrator.260 /// @param new_admin Address of the removed administrator.
266 fn remove_collection_admin(&self, caller: caller, admin: address) -> Result<void> {261 fn remove_collection_admin(&self, caller: caller, admin: address) -> Result<void> {
267 let caller = T::CrossAccountId::from_eth(caller);262 let caller = T::CrossAccountId::from_eth(caller);
271 }266 }
272267
273 /// Toggle accessibility of collection nesting.268 /// Toggle accessibility of collection nesting.
274 /// 269 ///
275 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'270 /// @param enable If "true" degenerates to nesting: 'Owner' else to nesting: 'Disabled'
276 #[solidity(rename_selector = "setCollectionNesting")]271 #[solidity(rename_selector = "setCollectionNesting")]
277 fn set_nesting_bool(&mut self, caller: caller, enable: bool) -> Result<void> {272 fn set_nesting_bool(&mut self, caller: caller, enable: bool) -> Result<void> {
294 }289 }
295290
296 /// Toggle accessibility of collection nesting.291 /// Toggle accessibility of collection nesting.
297 /// 292 ///
298 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'293 /// @param enable If "true" degenerates to nesting: {OwnerRestricted: [1, 2, 3]} else to nesting: 'Disabled'
299 /// @param collections Addresses of collections that will be available for nesting.294 /// @param collections Addresses of collections that will be available for nesting.
300 #[solidity(rename_selector = "setCollectionNesting")]295 #[solidity(rename_selector = "setCollectionNesting")]
367 }362 }
368363
369 /// Add the user to the allowed list.364 /// Add the user to the allowed list.
370 /// 365 ///
371 /// @param user Address of a trusted user.366 /// @param user Address of a trusted user.
372 fn add_to_collection_allow_list(&self, caller: caller, user: address) -> Result<void> {367 fn add_to_collection_allow_list(&self, caller: caller, user: address) -> Result<void> {
373 let caller = T::CrossAccountId::from_eth(caller);368 let caller = T::CrossAccountId::from_eth(caller);
377 }372 }
378 373
379 /// Remove the user from the allowed list.374 /// Remove the user from the allowed list.
380 /// 375 ///
381 /// @param user Address of a removed user.376 /// @param user Address of a removed user.
382 fn remove_from_collection_allow_list(&self, caller: caller, user: address) -> Result<void> {377 fn remove_from_collection_allow_list(&self, caller: caller, user: address) -> Result<void> {
383 let caller = T::CrossAccountId::from_eth(caller);378 let caller = T::CrossAccountId::from_eth(caller);
387 }382 }
388383
389 /// Switch permission for minting.384 /// Switch permission for minting.
390 /// 385 ///
391 /// @param mode Enable if "true".386 /// @param mode Enable if "true".
392 fn set_collection_mint_mode(&mut self, caller: caller, mode: bool) -> Result<void> {387 fn set_collection_mint_mode(&mut self, caller: caller, mode: bool) -> Result<void> {
393 check_is_owner_or_admin(caller, self)?;388 check_is_owner_or_admin(caller, self)?;
modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -17,11 +17,11 @@
 //! # Common pallet
 //!
 //! The Common pallet provides functionality for handling collections.
-//! 
+//!
 //! ## Overview
-//! 
+//!
 //! The Common pallet provides functions for:
-//! 
+//!
 //! - Setting and approving collection soponsor.
 //! - Get\set\delete allow list.
 //! - Get\set\delete collection properties.
@@ -32,25 +32,24 @@
 //! - Provides an interface for common collection operations for different collection types.
 //! - Provides dispatching for implementations of common collection operations, see [dispatch] module.
 //! - Provides functionality of collection into evm, see [erc] and [eth] module.
-//! 
+//!
 //! ### Terminology
-//! **Collection sponsor** - For the collection, you can set a sponsor, at whose expense it will 
+//! **Collection sponsor** - For the collection, you can set a sponsor, at whose expense it will
 //! be possible to mint tokens.
-//! 
+//!
 //! **Allow list** - List of users who have the right to minting tokens.
-//! 
-//! **Collection properties** - Collection properties are simply key-value stores where various 
+//!
+//! **Collection properties** - Collection properties are simply key-value stores where various
 //! metadata can be placed.
-//! 
-//! **Collection property permissions** - For each property in the collection can be set permission 
+//!
+//! **Collection property permissions** - For each property in the collection can be set permission
 //! to change, see [PropertyPermission].
-//! 
-//! **Permissions on token properties** - Similar to _permissions on collection properties_, 
+//!
+//! **Permissions on token properties** - Similar to _permissions on collection properties_,
 //! only restrictions apply to token properties.
-//! 
-//! **Collection administrator** - For a collection, you can set administrators who have the right 
+//!
+//! **Collection administrator** - For a collection, you can set administrators who have the right
 //! to most actions on the collection.
-
 
 #![warn(missing_docs)]
 #![cfg_attr(not(feature = "std"), no_std)]
@@ -131,7 +130,7 @@
 /// Weight info.
 pub type SelfWeightOf<T> = <T as Config>::WeightInfo;
 
-/// Collection handle contains information about collection data and id. 
+/// Collection handle contains information about collection data and id.
 /// Also provides functionality to count consumed gas.
 #[must_use = "Should call submit_logs or save, otherwise some data will be lost for evm side"]
 pub struct CollectionHandle<T: Config> {
@@ -208,9 +207,9 @@
 	}
 
 	/// Set collection sponsor.
-	/// 
-	/// Unique collections allows sponsoring for certain actions. 
-	/// This method allows you to set the sponsor of the collection. 
+	///
+	/// Unique collections allows sponsoring for certain actions.
+	/// This method allows you to set the sponsor of the collection.
 	/// In order for sponsorship to become active, it must be confirmed through [Self::confirm_sponsorship].
 	pub fn set_sponsor(&mut self, sponsor: T::AccountId) -> DispatchResult {
 		self.collection.sponsorship = SponsorshipState::Unconfirmed(sponsor);
@@ -218,7 +217,7 @@
 	}
 
 	/// Confirm sponsorship
-	/// 
+	///
 	/// In order for the sponsorship to become active, the user set as the sponsor must confirm their participation.
 	/// Before confirming sponsorship, the user must be specified as the sponsor of the collection via [Self::set_sponsor].
 	pub fn confirm_sponsorship(&mut self, sender: &T::AccountId) -> Result<bool, DispatchError> {
@@ -379,13 +378,13 @@
 			/// [CollectionMode] converted into _u8_.
 			u8,
 			/// Collection owner.
-			T::AccountId
+			T::AccountId,
 		),
 
 		/// New collection was destroyed
 		CollectionDestroyed(
 			/// Globally unique identifier of collection.
-			CollectionId
+			CollectionId,
 		),
 
 		/// New item was created.
@@ -397,7 +396,7 @@
 			/// Owner of newly created item
 			T::CrossAccountId,
 			/// Always 1 for NFT
-			u128
+			u128,
 		),
 
 		/// Collection item was burned.
@@ -409,7 +408,8 @@
 			/// Which user has destroyed its tokens.
 			T::CrossAccountId,
 			/// Amount of token pieces destroed. Always 1 for NFT.
-			u128),
+			u128,
+		),
 
 		/// Item was transferred
 		Transfer(
@@ -444,17 +444,17 @@
 			/// Id of collection to which property has been set.
 			CollectionId,
 			/// The property that was set.
-			PropertyKey
+			PropertyKey,
 		),
-		
+
 		/// The property has been deleted.
 		CollectionPropertyDeleted(
 			/// Id of collection to which property has been deleted.
 			CollectionId,
 			/// The property that was deleted.
-			PropertyKey
+			PropertyKey,
 		),
-		
+
 		/// The token property has been set.
 		TokenPropertySet(
 			/// Identifier of the collection whose token has the property set.
@@ -462,10 +462,9 @@
 			/// The token for which the property was set.
 			TokenId,
 			/// The property that was set.
-			PropertyKey
+			PropertyKey,
 		),
-		
-		
+
 		/// The token property has been deleted.
 		TokenPropertyDeleted(
 			/// Identifier of the collection whose token has the property deleted.
@@ -473,15 +472,15 @@
 			/// The token for which the property was deleted.
 			TokenId,
 			/// The property that was deleted.
-			PropertyKey
+			PropertyKey,
 		),
-		
+
 		/// The colletion property permission has been set.
 		PropertyPermissionSet(
 			/// Id of collection to which property permission has been set.
 			CollectionId,
 			/// The property permission that was set.
-			PropertyKey
+			PropertyKey,
 		),
 	}
 
@@ -735,7 +734,7 @@
 
 impl<T: Config> Pallet<T> {
 	/// Enshure that receiver address is correct.
-	/// 
+	///
 	/// Ethereum receiver 0x0000000000000000000000000000000000000000 is reserved, and shouldn't own tokens.
 	pub fn ensure_correct_receiver(receiver: &T::CrossAccountId) -> DispatchResult {
 		ensure!(
@@ -886,13 +885,13 @@
 
 impl<T: Config> Pallet<T> {
 	/// Create new collection.
-	/// 
+	///
 	/// * `owner` - The owner of the collection.
 	/// * `data` - Description of the created collection.
 	/// * `is_external` - Marks that collection managet by not "Unique network".
 	pub fn init_collection(
 		owner: T::CrossAccountId,
-		data: CreateCollectionData<T::AccountId>, 
+		data: CreateCollectionData<T::AccountId>,
 		is_external: bool,
 	) -> Result<CollectionId, DispatchError> {
 		{
@@ -991,7 +990,7 @@
 	}
 
 	/// Destroy collection.
-	/// 
+	///
 	/// * `collection` - Collection handler.
 	/// * `sender` - The owner or administrator of the collection.
 	pub fn destroy_collection(
@@ -1023,7 +1022,7 @@
 	}
 
 	/// Set collection property.
-	/// 
+	///
 	/// * `collection` - Collection handler.
 	/// * `sender` - The owner or administrator of the collection.
 	/// * `property` - The property to set.
@@ -1046,7 +1045,7 @@
 	}
 
 	/// Set scouped collection property.
-	/// 
+	///
 	/// * `collection_id` - ID of the collection for which the property is being set.
 	/// * `scope` - Property scope.
 	/// * `property` - The property to set.
@@ -1059,12 +1058,12 @@
 			properties.try_scoped_set(scope, property.key, property.value)
 		})
 		.map_err(<Error<T>>::from)?;
-		
+
 		Ok(())
 	}
-	
+
 	/// Set scouped collection properties.
-	/// 
+	///
 	/// * `collection_id` - ID of the collection for which the properties is being set.
 	/// * `scope` - Property scope.
 	/// * `properties` - The properties to set.
@@ -1082,7 +1081,7 @@
 	}
 
 	/// Set collection properties.
-	/// 
+	///
 	/// * `collection` - Collection handler.
 	/// * `sender` - The owner or administrator of the collection.
 	/// * `properties` - The properties to set.
@@ -1095,12 +1094,12 @@
 		for property in properties {
 			Self::set_collection_property(collection, sender, property)?;
 		}
-		
+
 		Ok(())
 	}
-	
+
 	/// Delete collection property.
-	/// 
+	///
 	/// * `collection` - Collection handler.
 	/// * `sender` - The owner or administrator of the collection.
 	/// * `property` - The property to delete.
@@ -1110,22 +1109,22 @@
 		property_key: PropertyKey,
 	) -> DispatchResult {
 		collection.check_is_owner_or_admin(sender)?;
-		
+
 		CollectionProperties::<T>::try_mutate(collection.id, |properties| {
 			properties.remove(&property_key)
 		})
 		.map_err(<Error<T>>::from)?;
-		
+
 		Self::deposit_event(Event::CollectionPropertyDeleted(
 			collection.id,
 			property_key,
 		));
-		
+
 		Ok(())
 	}
-	
+
 	/// Delete collection properties.
-	/// 
+	///
 	/// * `collection` - Collection handler.
 	/// * `sender` - The owner or administrator of the collection.
 	/// * `properties` - The properties to delete.
@@ -1138,14 +1137,14 @@
 		for key in property_keys {
 			Self::delete_collection_property(collection, sender, key)?;
 		}
-		
+
 		Ok(())
 	}
-	
+
 	/// Set collection propetry permission without any checks.
-	/// 
+	///
 	/// Used for migrations.
-	/// 
+	///
 	/// * `collection` - Collection handler.
 	/// * `property_permissions` - Property permissions.
 	pub fn set_property_permission_unchecked(
@@ -1160,7 +1159,7 @@
 	}
 
 	/// Set collection property permission.
-	/// 
+	///
 	/// * `collection` - Collection handler.
 	/// * `sender` - The owner or administrator of the collection.
 	/// * `property_permission` - Property permission.
@@ -1195,7 +1194,7 @@
 	}
 
 	/// Set token property permission.
-	/// 
+	///
 	/// * `collection` - Collection handler.
 	/// * `sender` - The owner or administrator of the collection.
 	/// * `property_permissions` - Property permissions.
@@ -1430,12 +1429,12 @@
 	fn burn_item() -> Weight;
 
 	/// Property setting weight.
-	/// 
+	///
 	/// * `amount`- The number of properties to set.
 	fn set_collection_properties(amount: u32) -> Weight;
 
 	/// Collection property deletion weight.
-	/// 
+	///
 	/// * `amount`- The number of properties to set.
 	fn delete_collection_properties(amount: u32) -> Weight;
 
@@ -1445,13 +1444,12 @@
 	fn set_token_properties(amount: u32) -> Weight;
 
 	/// Token property deletion weight.
-	/// 
+	///
 	/// * `amount`- The number of properties to delete.
 	fn delete_token_properties(amount: u32) -> Weight;
-	
-	
+
 	/// Token property permissions set weight.
-	/// 
+	///
 	/// * `amount`- The number of property permissions to set.
 	fn set_token_property_permissions(amount: u32) -> Weight;
 
@@ -1466,21 +1464,21 @@
 
 	/// The price of burning a token from another user.
 	fn burn_from() -> Weight;
-	
+
 	/// Differs from burn_item in case of Fungible and Refungible, as it should burn
 	/// whole users's balance
 	///
 	/// This method shouldn't be used directly, as it doesn't count breadth price, use [burn_recursively](CommonWeightInfo::burn_recursively) instead
 	fn burn_recursively_self_raw() -> Weight;
-	
+
 	/// Cost of iterating over `amount` children while burning, without counting child burning itself
 	///
 	/// This method shouldn't be used directly, as it doesn't count depth price, use [burn_recursively](CommonWeightInfo::burn_recursively) instead
 	fn burn_recursively_breadth_raw(amount: u32) -> Weight;
-	
+
 	/// The price of recursive burning a token.
 	///
-	/// `max_selfs` - 
+	/// `max_selfs` -
 	fn burn_recursively(max_selfs: u32, max_breadth: u32) -> Weight {
 		Self::burn_recursively_self_raw()
 			.saturating_mul(max_selfs.max(1) as u64)
@@ -1495,12 +1493,12 @@
 }
 
 /// Common collection operations.
-/// 
+///
 /// It wraps methods in Fungible, Nonfungible and Refungible pallets
 /// and adds weight info.
 pub trait CommonCollectionOperations<T: Config> {
 	/// Create token.
-	/// 
+	///
 	/// * `sender` - The user who mint the token and pays for the transaction.
 	/// * `to` - The user who will own the token.
 	/// * `data` - Token data.
@@ -1514,7 +1512,7 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Create multiple tokens.
-	/// 
+	///
 	/// * `sender` - The user who mint the token and pays for the transaction.
 	/// * `to` - The user who will own the token.
 	/// * `data` - Token data.
@@ -1526,9 +1524,9 @@
 		data: Vec<CreateItemData>,
 		nesting_budget: &dyn Budget,
 	) -> DispatchResultWithPostInfo;
-	
+
 	/// Create multiple tokens.
-	/// 
+	///
 	/// * `sender` - The user who mint the token and pays for the transaction.
 	/// * `to` - The user who will own the token.
 	/// * `data` - Token data.
@@ -1541,7 +1539,7 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Burn token.
-	/// 
+	///
 	/// * `sender` - The user who owns the token.
 	/// * `token` - Token id that will burned.
 	/// * `amount` - The number of parts of the token that will be burned.
@@ -1551,9 +1549,9 @@
 		token: TokenId,
 		amount: u128,
 	) -> DispatchResultWithPostInfo;
-	
+
 	/// Burn token and all nested tokens recursievly.
-	/// 
+	///
 	/// * `sender` - The user who owns the token.
 	/// * `token` - Token id that will burned.
 	/// * `self_budget` - The budget that can be spent on burning tokens.
@@ -1567,7 +1565,7 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Set collection properties.
-	/// 
+	///
 	/// * `sender` - Must be either the owner of the collection or its admin.
 	/// * `properties` - Properties to be set.
 	fn set_collection_properties(
@@ -1577,7 +1575,7 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Delete collection properties.
-	/// 
+	///
 	/// * `sender` - Must be either the owner of the collection or its admin.
 	/// * `properties` - The properties to be removed.
 	fn delete_collection_properties(
@@ -1587,11 +1585,11 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Set token properties.
-	/// 
-	/// The appropriate [PropertyPermission] for the token property 
+	///
+	/// The appropriate [PropertyPermission] for the token property
 	/// must be set with [Self::set_token_property_permissions].
-	/// 
-	/// * `sender` - Must be either the owner of the token or its admin. 
+	///
+	/// * `sender` - Must be either the owner of the token or its admin.
 	/// * `token_id` - The token for which the properties are being set.
 	/// * `properties` - Properties to be set.
 	/// * `budget` - Budget for setting properties.
@@ -1604,11 +1602,11 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Remove token properties.
-	/// 
-	/// The appropriate [PropertyPermission] for the token property 
+	///
+	/// The appropriate [PropertyPermission] for the token property
 	/// must be set with [Self::set_token_property_permissions].
-	/// 
-	/// * `sender` - Must be either the owner of the token or its admin. 
+	///
+	/// * `sender` - Must be either the owner of the token or its admin.
 	/// * `token_id` - The token for which the properties are being remove.
 	/// * `property_keys` - Keys to remove corresponding properties.
 	/// * `budget` - Budget for removing properties.
@@ -1621,8 +1619,8 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Set token property permissions.
-	/// 
-	/// * `sender` - Must be either the owner of the token or its admin. 
+	///
+	/// * `sender` - Must be either the owner of the token or its admin.
 	/// * `token_id` - The token for which the properties are being set.
 	/// * `properties` - Properties to be set.
 	/// * `budget` - Budget for setting properties.
@@ -1633,7 +1631,7 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Transfer amount of token pieces.
-	/// 
+	///
 	/// * `sender` - Donor user.
 	/// * `to` - Recepient user.
 	/// * `token` - The token of which parts are being sent.
@@ -1649,7 +1647,7 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Grant access to another account to transfer parts of the token owned by the calling user via [Self::transfer_from].
-	/// 
+	///
 	/// * `sender` - The user who grants access to the token.
 	/// * `spender` - The user to whom the rights are granted.
 	/// * `token` - The token to which access is granted.
@@ -1661,11 +1659,11 @@
 		token: TokenId,
 		amount: u128,
 	) -> DispatchResultWithPostInfo;
-	
+
 	/// Send parts of a token owned by another user.
-	/// 
+	///
 	/// Before calling this method, you must grant rights to the calling user via [Self::approve].
-	/// 
+	///
 	/// * `sender` - The user who has access to the token.
 	/// * `from` - The user who owns the token.
 	/// * `to` - Recepient user.
@@ -1681,11 +1679,11 @@
 		amount: u128,
 		budget: &dyn Budget,
 	) -> DispatchResultWithPostInfo;
-	
+
 	/// Burn parts of a token owned by another user.
-	/// 
+	///
 	/// Before calling this method, you must grant rights to the calling user via [Self::approve].
-	/// 
+	///
 	/// * `sender` - The user who has access to the token.
 	/// * `from` - The user who owns the token.
 	/// * `token` - The token of which parts are being sent.
@@ -1701,7 +1699,7 @@
 	) -> DispatchResultWithPostInfo;
 
 	/// Check permission to nest token.
-	/// 
+	///
 	/// * `sender` - The user who initiated the check.
 	/// * `from` - The token that is checked for embedding.
 	/// * `under` - Token under which to check.
@@ -1715,19 +1713,19 @@
 	) -> DispatchResult;
 
 	/// Nest one token into another.
-	/// 
+	///
 	/// * `under` - Token holder.
 	/// * `to_nest` - Nested token.
 	fn nest(&self, under: TokenId, to_nest: (CollectionId, TokenId));
 
 	/// Unnest token.
-	/// 
+	///
 	/// * `under` - Token holder.
 	/// * `to_nest` - Token to unnest.
 	fn unnest(&self, under: TokenId, to_nest: (CollectionId, TokenId));
 
 	/// Get all user tokens.
-	/// 
+	///
 	/// * `account` - Account for which you need to get tokens.
 	fn account_tokens(&self, account: T::CrossAccountId) -> Vec<TokenId>;
 
@@ -1735,7 +1733,7 @@
 	fn collection_tokens(&self) -> Vec<TokenId>;
 
 	/// Check if the token exists.
-	/// 
+	///
 	/// * `token` - Id token to check.
 	fn token_exists(&self, token: TokenId) -> bool;
 
@@ -1743,18 +1741,18 @@
 	fn last_token_id(&self) -> TokenId;
 
 	/// Get the owner of the token.
-	/// 
+	///
 	/// * `token` - The token for which you need to find out the owner.
 	fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId>;
 
 	/// Get the value of the token property by key.
-	/// 
+	///
 	/// * `token` - Token property to get.
 	/// * `key` - Property name.
 	fn token_property(&self, token_id: TokenId, key: &PropertyKey) -> Option<PropertyValue>;
 
 	/// Get a set of token properties by key vector.
-	/// 
+	///
 	/// * `token` - Token property to get.
 	/// * `keys` - Vector of keys. If this parameter is [None](sp_std::result::Result),
 	/// then all properties are returned.
@@ -1764,7 +1762,7 @@
 	fn total_supply(&self) -> u32;
 
 	/// Amount of different tokens account has.
-	/// 
+	///
 	/// * `account` - The account for which need to get the balance.
 	fn account_balance(&self, account: T::CrossAccountId) -> u32;
 
@@ -1775,7 +1773,7 @@
 	fn total_pieces(&self, token: TokenId) -> Option<u128>;
 
 	/// Get the number of parts of the token that a trusted user can manage.
-	/// 
+	///
 	/// * `sender` - Trusted user.
 	/// * `spender` - Owner of the token.
 	/// * `token` - The token for which to get the value.
@@ -1796,9 +1794,9 @@
 	T: Config,
 {
 	/// Change the number of parts of the token.
-	/// 
+	///
 	/// When the value changes down, this function is equivalent to burning parts of the token.
-	/// 
+	///
 	/// * `sender` - The user calling the repartition operation. Must be the owner of the token.
 	/// * `token` - The token for which you want to change the number of parts.
 	/// * `amount` - The new value of the parts of the token.
@@ -1811,7 +1809,7 @@
 }
 
 /// Merge [DispatchResult] with [Weight] into [DispatchResultWithPostInfo].
-/// 
+///
 /// Used for [CommonCollectionOperations] implementations and flexible enough to do so.
 pub fn with_weight(res: DispatchResult, weight: Weight) -> DispatchResultWithPostInfo {
 	let post_info = PostDispatchInfo {