difftreelog
doc: modify properties fns
in: master
3 files changed
pallets/common/src/lib.rsdiffbeforeafterboth--- 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 <key> with the value provided `(<key>, Some(<value>))`
+ /// * removes a property under the <key> if the value is `None` `(<key>, 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<T>,
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<T>,
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<T>,
sender: &T::CrossAccountId,
pallets/nonfungible/src/lib.rsdiffbeforeafterboth577 })577 })578 }578 }579579580 /// Batch operation to add, edit or remove properties for the token580 /// A batch operation to add, edit or remove properties for a token.581 ///581 /// It sets or removes a token's properties according to582 /// All affected properties should have mutable permission and sender should have582 /// `properties_updates` contents:583 /// permission to edit those properties.583 /// * sets a property under the <key> with the value provided `(<key>, Some(<value>))`584 /// * removes a property under the <key> if the value is `None` `(<key>, None)`.584 ///585 ///585 /// - `nesting_budget`: Limit for searching parents in depth to check ownership.586 /// - `nesting_budget`: Limit for searching parents in-depth to check ownership.586 /// - `is_token_create`: Indicates that method is called during token initialization.587 /// - `is_token_create`: Indicates that method is called during token initialization.587 /// Allows to bypass ownership check.588 /// Allows to bypass ownership check.589 ///590 /// All affected properties should have `mutable` permission591 /// to be **deleted** or to be **set more than once**,592 /// and the sender should have permission to edit those properties.593 ///594 /// This function fires an event for each property change.595 /// In case of an error, all the changes (including the events) will be reverted596 /// since the function is transactional.588 #[transactional]597 #[transactional]589 fn modify_token_properties(598 fn modify_token_properties(590 collection: &NonfungibleHandle<T>,599 collection: &NonfungibleHandle<T>,pallets/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>,