From 91e514bdbb72865df5088f08cc2410a3ceddb5a9 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Fri, 13 Jan 2023 10:38:35 +0000 Subject: [PATCH] doc: modify properties fns --- --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -1198,6 +1198,15 @@ Ok(()) } + /// This function sets or removes a collection properties according to + /// `properties_updates` contents: + /// * sets a property under the with the value provided `(, Some())` + /// * removes a property under the if the value is `None` `(, None)`. + /// + /// This function fires an event for each property change. + /// In case of an error, all the changes (including the events) will be reverted + /// since the function is transactional. + #[transactional] fn modify_collection_properties( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -1297,7 +1306,6 @@ /// * `collection` - Collection handler. /// * `sender` - The owner or administrator of the collection. /// * `properties` - The properties to set. - #[transactional] pub fn set_collection_properties( collection: &CollectionHandle, sender: &T::CrossAccountId, @@ -1328,7 +1336,6 @@ /// * `collection` - Collection handler. /// * `sender` - The owner or administrator of the collection. /// * `properties` - The properties to delete. - #[transactional] pub fn delete_collection_properties( collection: &CollectionHandle, sender: &T::CrossAccountId, --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -577,14 +577,23 @@ }) } - /// Batch operation to add, edit or remove properties for the token + /// A batch operation to add, edit or remove properties for a token. + /// It sets or removes a token's properties according to + /// `properties_updates` contents: + /// * sets a property under the with the value provided `(, Some())` + /// * removes a property under the if the value is `None` `(, None)`. /// - /// All affected properties should have mutable permission and sender should have - /// permission to edit those properties. - /// - /// - `nesting_budget`: Limit for searching parents in depth to check ownership. + /// - `nesting_budget`: Limit for searching parents in-depth to check ownership. /// - `is_token_create`: Indicates that method is called during token initialization. /// Allows to bypass ownership check. + /// + /// All affected properties should have `mutable` permission + /// to be **deleted** or to be **set more than once**, + /// and the sender should have permission to edit those properties. + /// + /// This function fires an event for each property change. + /// In case of an error, all the changes (including the events) will be reverted + /// since the function is transactional. #[transactional] fn modify_token_properties( collection: &NonfungibleHandle, --- a/pallets/refungible/src/lib.rs +++ b/pallets/refungible/src/lib.rs @@ -515,6 +515,23 @@ Ok(()) } + /// A batch operation to add, edit or remove properties for a token. + /// It sets or removes a token's properties according to + /// `properties_updates` contents: + /// * sets a property under the with the value provided `(, Some())` + /// * removes a property under the if the value is `None` `(, None)`. + /// + /// - `nesting_budget`: Limit for searching parents in-depth to check ownership. + /// - `is_token_create`: Indicates that method is called during token initialization. + /// Allows to bypass ownership check. + /// + /// All affected properties should have `mutable` permission + /// to be **deleted** or to be **set more than once**, + /// and the sender should have permission to edit those properties. + /// + /// This function fires an event for each property change. + /// In case of an error, all the changes (including the events) will be reverted + /// since the function is transactional. #[transactional] fn modify_token_properties( collection: &RefungibleHandle, -- gitstuff