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

difftreelog

fix weights for `mint_with_token_uri`, `mint_bulk_with_token_uri`

PraetorP2023-01-23parent: #befa82f.patch.diff
in: master

2 files changed

modifiedpallets/nonfungible/src/erc.rsdiffbeforeafterboth
590 /// @param tokenUri Token URI that would be stored in the NFT properties590 /// @param tokenUri Token URI that would be stored in the NFT properties
591 /// @return uint256 The id of the newly minted token591 /// @return uint256 The id of the newly minted token
592 #[solidity(rename_selector = "mintWithTokenURI")]592 #[solidity(rename_selector = "mintWithTokenURI")]
593 #[weight(<SelfWeightOf<T>>::create_item())]593 #[weight(<SelfWeightOf<T>>::create_item() + <SelfWeightOf<T>>::set_token_properties(1))]
594 fn mint_with_token_uri(594 fn mint_with_token_uri(
595 &mut self,595 &mut self,
596 caller: Caller,596 caller: Caller,
612 /// @param tokenId ID of the minted NFT612 /// @param tokenId ID of the minted NFT
613 /// @param tokenUri Token URI that would be stored in the NFT properties613 /// @param tokenUri Token URI that would be stored in the NFT properties
614 #[solidity(hide, rename_selector = "mintWithTokenURI")]614 #[solidity(hide, rename_selector = "mintWithTokenURI")]
615 #[weight(<SelfWeightOf<T>>::create_item())]615 #[weight(<SelfWeightOf<T>>::create_item() + <SelfWeightOf<T>>::set_token_properties(1))]
616 fn mint_with_token_uri_check_id(616 fn mint_with_token_uri_check_id(
617 &mut self,617 &mut self,
618 caller: Caller,618 caller: Caller,
943 /// @param to The new owner943 /// @param to The new owner
944 /// @param tokens array of pairs of token ID and token URI for minted tokens944 /// @param tokens array of pairs of token ID and token URI for minted tokens
945 #[solidity(hide, rename_selector = "mintBulkWithTokenURI")]945 #[solidity(hide, rename_selector = "mintBulkWithTokenURI")]
946 #[weight(<SelfWeightOf<T>>::create_multiple_items(tokens.len() as u32))]946 #[weight(<SelfWeightOf<T>>::create_multiple_items(tokens.len() as u32) + <SelfWeightOf<T>>::set_token_properties(tokens.len() as u32))]
947 fn mint_bulk_with_token_uri(947 fn mint_bulk_with_token_uri(
948 &mut self,948 &mut self,
949 caller: Caller,949 caller: Caller,
modifiedpallets/refungible/src/erc.rsdiffbeforeafterboth
--- a/pallets/refungible/src/erc.rs
+++ b/pallets/refungible/src/erc.rs
@@ -629,7 +629,7 @@
 	/// @param tokenUri Token URI that would be stored in the NFT properties
 	/// @return uint256 The id of the newly minted token
 	#[solidity(rename_selector = "mintWithTokenURI")]
-	#[weight(<SelfWeightOf<T>>::create_item())]
+	#[weight(<SelfWeightOf<T>>::create_item() + <SelfWeightOf<T>>::set_token_properties(1))]
 	fn mint_with_token_uri(
 		&mut self,
 		caller: Caller,
@@ -651,7 +651,7 @@
 	/// @param tokenId ID of the minted RFT
 	/// @param tokenUri Token URI that would be stored in the RFT properties
 	#[solidity(hide, rename_selector = "mintWithTokenURI")]
-	#[weight(<SelfWeightOf<T>>::create_item())]
+	#[weight(<SelfWeightOf<T>>::create_item() + <SelfWeightOf<T>>::set_token_properties(1))]
 	fn mint_with_token_uri_check_id(
 		&mut self,
 		caller: Caller,
@@ -994,7 +994,7 @@
 	/// @param to The new owner
 	/// @param tokens array of pairs of token ID and token URI for minted tokens
 	#[solidity(hide, rename_selector = "mintBulkWithTokenURI")]
-	#[weight(<SelfWeightOf<T>>::create_multiple_items(tokens.len() as u32))]
+	#[weight(<SelfWeightOf<T>>::create_multiple_items(tokens.len() as u32) + <SelfWeightOf<T>>::set_token_properties(tokens.len() as u32))]
 	fn mint_bulk_with_token_uri(
 		&mut self,
 		caller: Caller,