git.delta.rocks / unique-network / refs/commits / d1f105e686c1

difftreelog

doc: add requested code review changes

Grigoriy Simonov2022-07-21parent: #ce4a2a5.patch.diff
in: master

2 files changed

modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
137 /// @dev Throws error if key not found137 /// @dev Throws error if key not found
138 /// @param tokenId ID of the token.138 /// @param tokenId ID of the token.
139 /// @param key Property key.139 /// @param key Property key.
140 /// @return Property value bytes
140 fn property(&self, token_id: uint256, key: string) -> Result<bytes> {141 fn property(&self, token_id: uint256, key: string) -> Result<bytes> {
141 let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;142 let token_id: u32 = token_id.try_into().map_err(|_| "token id overflow")?;
142 let key = <Vec<u8>>::from(key)143 let key = <Vec<u8>>::from(key)
modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -86,7 +86,6 @@
 //!
 //! ## Assumptions
 //!
-//! * Total number of tokens of all types shouldn't be greater than `up_data_structs::MAX_TOKEN_PREFIX_LENGTH`.
 //! * Sender should be in collection's allow list to perform operations on tokens.
 
 #![cfg_attr(not(feature = "std"), no_std)]
@@ -845,6 +844,7 @@
 	/// If `to` is token than `to` becomes owner of the token and the token become nested.
 	/// Unnests token from previous parent if it was nested before.
 	/// Removes allowance for the token if there was any.
+	/// Throws if transfers aren't allowed for collection or if receiver reached token ownership limit.
 	///
 	/// - `nesting_budget`: Limit for token nesting depth
 	pub fn transfer(
@@ -942,8 +942,11 @@
 	///
 	/// The sender should be the owner/admin of the collection or collection should be configured
 	/// to allow public minting.
+	/// Throws if amount of tokens reached it's limit for the collection or if caller reached
+	/// token ownership limit.
 	///
-	/// - `data`: Contains list of token properties and users who will become the owners of the corresponging tokens.
+	/// - `data`: Contains list of token properties and users who will become the owners of the
+	///   corresponging tokens.
 	/// - `nesting_budget`: Limit for token nesting depth
 	pub fn create_multiple_items(
 		collection: &NonfungibleHandle<T>,