git.delta.rocks / unique-network / refs/commits / 91e514bdbb72

difftreelog

doc: modify properties fns

Daniel Shiposha2023-01-13parent: #5906b72.patch.diff
in: master

3 files changed

modifiedpallets/common/src/lib.rsdiffbeforeafterboth
1198 Ok(())1198 Ok(())
1199 }1199 }
12001200
1201 /// This function sets or removes a collection properties according to
1202 /// `properties_updates` contents:
1203 /// * sets a property under the <key> with the value provided `(<key>, Some(<value>))`
1204 /// * removes a property under the <key> if the value is `None` `(<key>, None)`.
1205 ///
1206 /// This function fires an event for each property change.
1207 /// In case of an error, all the changes (including the events) will be reverted
1208 /// since the function is transactional.
1209 #[transactional]
1201 fn modify_collection_properties(1210 fn modify_collection_properties(
1202 collection: &CollectionHandle<T>,1211 collection: &CollectionHandle<T>,
1203 sender: &T::CrossAccountId,1212 sender: &T::CrossAccountId,
1297 /// * `collection` - Collection handler.1306 /// * `collection` - Collection handler.
1298 /// * `sender` - The owner or administrator of the collection.1307 /// * `sender` - The owner or administrator of the collection.
1299 /// * `properties` - The properties to set.1308 /// * `properties` - The properties to set.
1300 #[transactional]
1301 pub fn set_collection_properties(1309 pub fn set_collection_properties(
1302 collection: &CollectionHandle<T>,1310 collection: &CollectionHandle<T>,
1303 sender: &T::CrossAccountId,1311 sender: &T::CrossAccountId,
1328 /// * `collection` - Collection handler.1336 /// * `collection` - Collection handler.
1329 /// * `sender` - The owner or administrator of the collection.1337 /// * `sender` - The owner or administrator of the collection.
1330 /// * `properties` - The properties to delete.1338 /// * `properties` - The properties to delete.
1331 #[transactional]
1332 pub fn delete_collection_properties(1339 pub fn delete_collection_properties(
1333 collection: &CollectionHandle<T>,1340 collection: &CollectionHandle<T>,
1334 sender: &T::CrossAccountId,1341 sender: &T::CrossAccountId,
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
--- 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 <key> with the value provided `(<key>, Some(<value>))`
+	/// * removes a property under the <key> if the value is `None` `(<key>, 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<T>,
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
--- 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 <key> with the value provided `(<key>, Some(<value>))`
+	/// * removes a property under the <key> if the value is `None` `(<key>, 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<T>,