From c3d6374a4643a66e3f5d791a77a9db338bf38656 Mon Sep 17 00:00:00 2001 From: PraetorP Date: Mon, 23 Jan 2023 13:14:31 +0000 Subject: [PATCH] fix: weights for `mint_with_token_uri`, `mint_bulk_with_token_uri` --- --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -590,7 +590,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(>::create_item())] + #[weight(>::create_item() + >::set_token_properties(1))] fn mint_with_token_uri( &mut self, caller: Caller, @@ -612,7 +612,7 @@ /// @param tokenId ID of the minted NFT /// @param tokenUri Token URI that would be stored in the NFT properties #[solidity(hide, rename_selector = "mintWithTokenURI")] - #[weight(>::create_item())] + #[weight(>::create_item() + >::set_token_properties(1))] fn mint_with_token_uri_check_id( &mut self, caller: Caller, @@ -943,7 +943,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(>::create_multiple_items(tokens.len() as u32))] + #[weight(>::create_multiple_items(tokens.len() as u32) + >::set_token_properties(tokens.len() as u32))] fn mint_bulk_with_token_uri( &mut self, caller: Caller, --- 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(>::create_item())] + #[weight(>::create_item() + >::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(>::create_item())] + #[weight(>::create_item() + >::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(>::create_multiple_items(tokens.len() as u32))] + #[weight(>::create_multiple_items(tokens.len() as u32) + >::set_token_properties(tokens.len() as u32))] fn mint_bulk_with_token_uri( &mut self, caller: Caller, -- gitstuff