From b803cc133b45b83e0077bf3e3591542b57a15340 Mon Sep 17 00:00:00 2001 From: Daniel Bigos Date: Wed, 15 May 2024 17:45:17 +0200 Subject: [PATCH] ref: apply CR comments --- .../src/erc721/extensions/uri_storage.rs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contracts/src/erc721/extensions/uri_storage.rs b/contracts/src/erc721/extensions/uri_storage.rs index 831a87222..4fce404ae 100644 --- a/contracts/src/erc721/extensions/uri_storage.rs +++ b/contracts/src/erc721/extensions/uri_storage.rs @@ -8,14 +8,6 @@ use alloy_sol_types::sol; use stylus_proc::{external, sol_storage}; use stylus_sdk::evm; -sol_storage! { - /// Uri Storage. - pub struct ERC721UriStorage { - /// Optional mapping for token URIs. - mapping(uint256 => string) _token_uris; - } -} - sol! { /// This event gets emitted when the metadata of a token is changed. /// @@ -30,6 +22,14 @@ sol! { event BatchMetadataUpdate(uint256 from_token_id, uint256 to_token_id); } +sol_storage! { + /// Uri Storage. + pub struct ERC721UriStorage { + /// Optional mapping for token URIs. + mapping(uint256 => string) _token_uris; + } +} + #[external] impl ERC721UriStorage { /// Returns the Uniform Resource Identifier (URI) for `token_id` token. @@ -49,7 +49,7 @@ impl ERC721UriStorage { /// /// * `&mut self` - Write access to the contract's state. /// * `token_id` - Id of a token. - /// * `token_uri` - . + /// * `token_uri` - URI for the token. /// /// # Events /// Emits a [`MetadataUpdate`] event. @@ -78,7 +78,7 @@ mod tests { fn random_token_id() -> U256 { let num: u32 = rand::random(); - num.try_into().expect("conversion to U256") + U256::from(num) } #[grip::test]