Skip to content

fixed warnings due to outdated methods and imports#18

Open
Pfed-prog wants to merge 4 commits intoRegen-Bazaar:mainfrom
Pfed-prog:main
Open

fixed warnings due to outdated methods and imports#18
Pfed-prog wants to merge 4 commits intoRegen-Bazaar:mainfrom
Pfed-prog:main

Conversation

@Pfed-prog
Copy link
Contributor

@Pfed-prog Pfed-prog commented Sep 27, 2025

Summary by CodeRabbit

  • New Features

    • Richer NFT marketplace actions: create, buy, update price, toggle availability; events emitted for these actions.
  • Refactor

    • Standardized contract initialization and strengthened typing for more predictable behavior.
    • Price handling unified to signed integer representation for monetary fields.
  • Tests

    • Tests updated to match new initialization patterns and explicit typings.

@coderabbitai
Copy link

coderabbitai bot commented Sep 27, 2025

Walkthrough

Tests and contracts were updated for Env API changes and stronger typing. Marketplace was refactored to a typed NFT model (new NFT/NFTStatus types, typed storage and events, create/buy/update/toggle flows) and monetary fields changed from u128 to i128. Several tests use explicit types and env.register(..., ()).

Changes

Cohort / File(s) Summary
Marketplace — tests & token setup
contracts/market-place-contract/src/test.rs
Test now registers the Stellar asset via register_stellar_asset_contract_v2, obtains token address with token.address(), constructs StellarAssetClient directly, and registers the marketplace with env.register(MarketplaceContract, ()). Added imports for MarketplaceContract, MarketplaceContractClient, NFTStatus, and ContractError.
Marketplace — contract logic, events, storage, exports
contracts/market-place-contract/src/contract.rs, contracts/market-place-contract/src/events.rs, contracts/market-place-contract/src/storage.rs, contracts/market-place-contract/src/lib.rs
Introduced typed NFT and NFTStatus; created explicit NFT creation flow and updated buy/update/toggle flows to operate on NFT. Switched price-related types from u128 to i128, added explicit local/storage typing, emitted explicit events, and removed pub use contract::* / pub use events::* re-exports.
Staking — tests & library typing
contracts/staking/src/test.rs, contracts/staking/src/lib.rs
Test registrations updated to env.register(Type, ()). lib.rs gained crate-local type imports, lifetime-parameterized clients (e.g., NftClient<'_>), and many explicit numeric and lifetime type annotations and conversions.
Hello-world — test typing
contracts/hello-world/src/test.rs
Added explicit imports and type annotations (Env, Address, ContractClient<'_>, Vec<String>) for test variables and results.
Impact-buyer — imports reordering
impact-buyer/src/test.rs
Removed super::* wildcard import and explicitly imported NftClient and NftInterface from crate::interfaces, reordering imports.

Sequence Diagram(s)

sequenceDiagram
    actor T as Test
    participant E as Env
    participant F as AssetFactory
    participant TC as TokenContract
    participant C as StellarAssetClient
    participant M as Marketplace

    Note over T,E: Token and marketplace registration (updated)
    T->>E: register_stellar_asset_contract_v2(...)
    E-->>T: TokenContract handle
    T->>TC: address()
    TC-->>T: token_address
    T->>C: StellarAssetClient::new(&env, &token_address)
    T->>E: register(MarketplaceContract, ())
    E-->>T: marketplace_id
Loading
sequenceDiagram
    actor User as Caller
    participant M as MarketplaceContract
    participant S as Storage
    participant T as TokenClient
    participant Ev as Events

    Note over Caller,M: create_nft(creator, name, desc, category, image_url, price:i128, token_address)
    Caller->>M: create_nft(...)
    M->>S: get_next_nft_id() -> id (u64)
    M->>S: set_nft(id, NFT{... price:i128, status, timestamps })
    M->>S: add_creator_nft / add_owner_nft / add_category_nft / add_all_nft_id
    M->>Ev: emit_nft_created(NFT)
    M-->>Caller: Result<u64, ContractError>
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I twitch my whiskers at new lines of code,
IDs counted, typed, and neatly stowed.
Tokens fetched, clients take their place,
NFTs hop into storage space.
A rabbit cheers — tests pass with grace. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The provided title claims the changes only fix warnings related to outdated methods and imports, but the pull request actually introduces significant API migrations (e.g., env.register_contract to env.register), updates core marketplace contract functionality (adding NFT structs, migrating to i128 pricing), and expands event and storage types. This makes the title misleading and not reflective of the main scope of the changes. Please update the title to clearly reflect the primary scope of the changes, for example: “Migrate to new Env.register API, switch marketplace pricing to i128, and expand NFT types and events.” This will give reviewers immediate insight into the major contract and type-system updates.
Docstring Coverage ⚠️ Warning Docstring coverage is 58.82% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Pfed-prog Pfed-prog changed the title fixed warnings due to outdated methods fixed warnings due to outdated methods and imports Sep 28, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
contracts/market-place-contract/src/contract.rs (4)

19-41: Missing creator authorization in create_nft

Anyone can mint on behalf of any address. Require the creator’s auth.

Apply:

 ) -> Result<u64, ContractError> {
     if price == 0 {
         return Err(ContractError::InvalidPrice);
     }
 
+    // Ensure only the creator can mint their NFT
+    creator.require_auth();
+
     let nft_id: u64 = get_next_nft_id(env);

72-78: Unsafe u128 → i128 cast and missing buyer auth in buy_nft

  • Casting u128 price to i128 with as can overflow and produce negatives.
  • Buyer auth is required before transferring their tokens.

Apply:

-    let token_client: token::TokenClient<'_> = token::Client::new(env, &nft.token_address);
-    token_client.transfer(buyer, &nft.owner, &(nft.price as i128));
+    // Buyer must authorize spending
+    buyer.require_auth();
+
+    let token_client: token::TokenClient<'_> = token::Client::new(env, &nft.token_address);
+    // Safely convert price to i128 expected by the token contract
+    let amount: i128 = match i128::try_from(nft.price) {
+        Ok(v) => v,
+        Err(_) => return Err(ContractError::InvalidPrice),
+    };
+    token_client.transfer(buyer, &nft.owner, &amount);

Also applies to: 76-80


108-116: Missing creator authorization in update_nft_price

Only the creator should be able to change price, and they must authorize the call.

Apply:

 pub fn update_nft_price(
     env: &Env,
     creator: &Address,
     nft_id: u64,
     new_price: u128,
 ) -> Result<(), ContractError> {
     let mut nft: NFT = get_nft(env, nft_id)?;
 
+    creator.require_auth();
+
     if nft.creator != *creator {
         return Err(ContractError::CreatorOnly);
     }

134-144: Missing creator authorization in toggle_nft_availability

Toggling availability should require the creator’s auth.

Apply:

 ) -> Result<(), ContractError> {
     let mut nft: NFT = get_nft(env, nft_id)?;
 
+    creator.require_auth();
+
     if nft.creator != *creator {
         return Err(ContractError::CreatorOnly);
     }
🧹 Nitpick comments (5)
impact-buyer/src/test.rs (1)

8-8: Import shift to explicit interfaces looks good

Switching to explicit NftClient (and away from a wildcard) aligns with the repo’s move toward stronger typing.

If NftInterface remains unused in this file, consider removing it to avoid an unused import warning.

contracts/market-place-contract/src/storage.rs (2)

62-66: Guard the ID counter against overflow (defensive)

While practically unlikely, u64 wrap is silent. Consider saturating or erroring if current == u64::MAX.

Apply:

 pub fn get_next_nft_id(env: &Env) -> u64 {
-    let current: u64 = get_nft_counter(env);
-    let next: u64 = current + 1;
+    let current: u64 = get_nft_counter(env);
+    let next: u64 = match current.checked_add(1) {
+        Some(v) => v,
+        None => {
+            // Option A: saturate
+            // return current;
+            // Option B: panic or introduce a ContractError and bubble it up.
+            panic!("NFT id overflow")
+        }
+    };
     env.storage().instance().set(&NFT_COUNTER, &next);
     next
 }

32-43: Unify counter keying (cleanup)

You define StorageKey::NFTCounter but use a separate NFT_COUNTER Symbol. Prefer one approach to avoid drift.

Two options:

  • Use StorageKey::NFTCounter in get_nft_counter/get_next_nft_id.
  • Or remove StorageKey::NFTCounter if you’ll keep the Symbol key.

Also applies to: 44-46, 57-66

contracts/market-place-contract/src/contract.rs (2)

114-121: Block price updates after a sale (policy suggestion)

Prevent changing price once an NFT is sold.

Apply:

     if new_price == 0 {
         return Err(ContractError::InvalidPrice);
     }
 
+    if matches!(nft.status, NFTStatus::Sold) {
+        return Err(ContractError::OperationNotAllowed);
+    }

221-241: Consider deriving totals from actual stored NFTs

total_nfts uses the counter, which may diverge if ever pruned. If you want current total, compute from get_all_nft_ids(env).len().

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8194f1 and 64d9321.

📒 Files selected for processing (8)
  • contracts/hello-world/src/test.rs (1 hunks)
  • contracts/market-place-contract/src/contract.rs (13 hunks)
  • contracts/market-place-contract/src/events.rs (4 hunks)
  • contracts/market-place-contract/src/lib.rs (0 hunks)
  • contracts/market-place-contract/src/storage.rs (2 hunks)
  • contracts/market-place-contract/src/test.rs (2 hunks)
  • contracts/staking/src/lib.rs (9 hunks)
  • impact-buyer/src/test.rs (1 hunks)
💤 Files with no reviewable changes (1)
  • contracts/market-place-contract/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • contracts/market-place-contract/src/test.rs
🧰 Additional context used
🧬 Code graph analysis (3)
contracts/market-place-contract/src/contract.rs (2)
contracts/market-place-contract/src/storage.rs (13)
  • get_next_nft_id (62-67)
  • get_nft (71-74)
  • set_nft (76-79)
  • add_creator_nft (88-93)
  • add_owner_nft (100-105)
  • add_category_nft (121-126)
  • add_all_nft_id (135-139)
  • remove_owner_nft (107-114)
  • get_all_nft_ids (128-133)
  • get_nft_counter (58-60)
  • get_owner_nfts (95-98)
  • get_category_nfts (116-119)
  • get_creator_nfts (83-86)
contracts/market-place-contract/src/events.rs (4)
  • emit_nft_created (40-56)
  • emit_nft_sold (58-74)
  • emit_nft_price_updated (76-90)
  • emit_nft_availability_toggled (92-104)
contracts/staking/src/lib.rs (3)
impact-buyer/src/test.rs (1)
  • owner (39-45)
contracts/staking/src/interfaces.rs (1)
  • owner (8-8)
contracts/staking/src/test.rs (1)
  • owner (15-23)
contracts/market-place-contract/src/storage.rs (2)
contracts/market-place-contract/src/contract.rs (1)
  • get_nft (159-161)
contracts/market-place-contract/src/lib.rs (1)
  • get_nft (83-85)
🔇 Additional comments (2)
contracts/market-place-contract/src/events.rs (1)

48-55: Type annotations are fine; no behavior change

Adding explicit event variable types is harmless and can aid readability. Emission topics and payloads remain unchanged.

Also applies to: 66-73, 83-90, 98-104

contracts/hello-world/src/test.rs (1)

3-4: LGTM: explicit typing and updated registration

Tests now use explicit types and the newer env.register path; assertions remain intact.

Also applies to: 9-11, 13-13

Comment on lines 4 to +7
use soroban_sdk::{token, Address, Env, String, Vec, Map};

use crate::{NFT, NFTStatus};
use crate::error::ContractError;
use crate::storage::{get_next_nft_id, get_nft as other_get_nft, set_nft, add_creator_nft, add_owner_nft, add_category_nft, add_all_nft_id, remove_owner_nft, get_all_nft_ids, get_nft_counter, get_owner_nfts, get_category_nfts, get_creator_nfts};
use crate::events::{emit_nft_created, emit_nft_sold, emit_nft_price_updated, emit_nft_availability_toggled};

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

Follow-up: unify monetary type to i128 across the module

Soroban token amounts are i128. Using u128 for price forces conversions and risks overflow. Consider migrating price (and related event fields) to i128 to remove casts and tighten type safety.

Run this to scan for auth and amount conversions in the marketplace contract:

Also applies to: 23-39, 60-99, 101-126, 128-154


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== require_auth occurrences =="
rg -n -C2 --type=rust '\brequire_auth\s*\(' contracts/market-place-contract/src/contract.rs

echo
echo "== transfer calls and amount types =="
rg -n -C2 --type=rust 'token_client\.transfer\(' contracts/market-place-contract/src/contract.rs

echo
echo "== price field type =="
rg -n -C2 --type=rust 'pub\s+price:\s*(i128|u128)' contracts/market-place-contract/src/{storage.rs,events.rs}

Length of output: 30


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Locating relevant files =="
CONTRACT_FILE=$(find contracts -type f -name contract.rs)
STORAGE_FILE=$(find contracts -type f -name storage.rs)
EVENTS_FILE=$(find contracts -type f -name events.rs)
echo "contract: $CONTRACT_FILE"
echo "storage: $STORAGE_FILE"
echo "events: $EVENTS_FILE"

echo
echo "== require_auth occurrences =="
rg -n -C2 --type=rust '\brequire_auth\s*\(' "$CONTRACT_FILE"

echo
echo "== transfer calls and amount types =="
rg -n -C2 --type=rust 'token_client\.transfer\(' "$CONTRACT_FILE"

echo
echo "== price field type in storage and events =="
rg -n -C2 --type=rust 'pub\s+price:\s*(i128|u128)' "$STORAGE_FILE" "$EVENTS_FILE" || true

Length of output: 229


🏁 Script executed:

#!/bin/bash
set -euo pipefail

FILE="contracts/market-place-contract/src/contract.rs"
STORAGE="contracts/market-place-contract/src/storage.rs"
EVENTS="contracts/market-place-contract/src/events.rs"

echo "== require_auth via Env =="
rg -n '\.require_auth' "$FILE" || true

echo
echo "== transfer calls =="
rg -n '\btransfer\s*\(' "$FILE" || true

echo
echo "== price field declarations =="
rg -n 'pub\s+price\s*:' "$STORAGE" "$EVENTS" || true

Length of output: 361


Unify price to i128 across the module
Change all pub price: u128 declarations to i128 in

  • contracts/market-place-contract/src/storage.rs (line 23)
  • contracts/market-place-contract/src/events.rs (lines 9, 19)
    and remove the as i128 cast on nft.price in contract.rs (e.g. the transfer call at line 77) to align with Soroban’s i128 token amounts.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
contracts/market-place-contract/src/contract.rs (1)

77-77: Remove redundant type cast.

Now that nft.price is i128 (changed in storage.rs line 23), the cast as i128 on line 77 is unnecessary and can be removed for clarity.

Apply this diff:

-    token_client.transfer(buyer, &nft.owner, &(nft.price as i128));
+    token_client.transfer(buyer, &nft.owner, &nft.price);
🧹 Nitpick comments (3)
contracts/market-place-contract/src/storage.rs (1)

63-64: Explicit type annotations improve clarity.

The addition of explicit type annotations throughout the storage functions enhances code readability and makes the intent clearer, though the compiler could infer these types. This is a good practice for contract code where clarity is paramount.

Also applies to: 72-72, 77-77, 84-84, 89-90, 96-96, 101-102, 108-109, 117-117, 122-123, 136-136

contracts/market-place-contract/src/events.rs (1)

48-48: Explicit event type annotations enhance clarity.

The explicit type annotations when constructing event structs improve readability and make the code's intent clearer, consistent with the annotation approach used throughout the refactor.

Also applies to: 66-66, 83-83, 98-98

contracts/market-place-contract/src/contract.rs (1)

23-24: Explicit type annotations enhance code clarity.

The addition of explicit type annotations throughout the contract functions improves readability and makes the code's intent clearer. While the compiler can infer these types, the explicit annotations are beneficial for contract code where clarity and maintainability are important.

Also applies to: 26-26, 66-66, 76-76, 79-79, 106-106, 108-108, 118-118, 134-134, 140-140, 149-149, 165-166, 179-180, 193-194, 207-208, 221-221, 223-223, 226-228

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 64d9321 and b50599b.

📒 Files selected for processing (5)
  • contracts/market-place-contract/src/contract.rs (13 hunks)
  • contracts/market-place-contract/src/events.rs (7 hunks)
  • contracts/market-place-contract/src/lib.rs (2 hunks)
  • contracts/market-place-contract/src/storage.rs (3 hunks)
  • contracts/market-place-contract/src/test.rs (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
contracts/market-place-contract/src/storage.rs (2)
contracts/market-place-contract/src/contract.rs (1)
  • get_nft (159-161)
contracts/market-place-contract/src/lib.rs (1)
  • get_nft (83-85)
contracts/market-place-contract/src/contract.rs (2)
contracts/market-place-contract/src/storage.rs (13)
  • get_next_nft_id (62-67)
  • get_nft (71-74)
  • set_nft (76-79)
  • add_creator_nft (88-93)
  • add_owner_nft (100-105)
  • add_category_nft (121-126)
  • add_all_nft_id (135-139)
  • remove_owner_nft (107-114)
  • get_all_nft_ids (128-133)
  • get_nft_counter (58-60)
  • get_owner_nfts (95-98)
  • get_category_nfts (116-119)
  • get_creator_nfts (83-86)
contracts/market-place-contract/src/events.rs (4)
  • emit_nft_created (40-56)
  • emit_nft_sold (58-74)
  • emit_nft_price_updated (76-90)
  • emit_nft_availability_toggled (92-104)
🔇 Additional comments (7)
contracts/market-place-contract/src/lib.rs (1)

37-37: LGTM! Price type correctly unified to i128.

The migration of price parameters from u128 to i128 aligns with Soroban's token standard, which uses i128 for all token amounts. This change eliminates unnecessary type conversions and improves type safety throughout the contract.

Also applies to: 64-64

contracts/market-place-contract/src/storage.rs (1)

23-23: Core type change correctly applied.

The NFT struct's price field migration to i128 is the foundation for the contract-wide type unification. This change is consistent with Soroban token standards and eliminates type conversion overhead.

contracts/market-place-contract/src/test.rs (3)

7-12: Test imports and constants correctly updated.

The test module now uses the current Soroban SDK imports (StellarAssetClient, explicit contract imports) and aligns the NFT_PRICE constant with the contract's i128 price type. These changes are necessary to work with the updated contract API.

Also applies to: 14-14


39-41: Token contract setup modernized correctly.

The test now uses register_stellar_asset_contract_v2 and StellarAssetClient, which are the current recommended approaches in the Soroban SDK. The pattern of registering the asset, retrieving its address, and constructing the client is correct.


46-46: Contract registration updated to current API.

The switch from env.register_contract(None, MarketplaceContract) to env.register(MarketplaceContract, ()) aligns with the current Soroban SDK API and resolves deprecation warnings. The empty tuple () represents no constructor arguments.

contracts/market-place-contract/src/events.rs (1)

9-9: Event price types correctly unified to i128.

All event structures and emission functions now consistently use i128 for price-related fields. This ensures that emitted events accurately reflect the contract's internal state and align with Soroban token standards, providing correct type information to external consumers.

Also applies to: 19-19, 28-29, 45-45, 63-63, 80-81

contracts/market-place-contract/src/contract.rs (1)

3-6: Imports consolidated and function signatures updated correctly.

The explicit imports from storage and events modules improve code organization, and the price: i128 parameter in create_nft aligns with the contract-wide type unification. These changes support better maintainability and type safety.

Also applies to: 16-16

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
contracts/market-place-contract/src/contract.rs (1)

220-242: LGTM! Stats computation is correct.

The function properly aggregates marketplace statistics with explicit typing. The iteration over all NFTs to compute counts is acceptable for moderate-sized collections.

Optional: For very large NFT collections, consider maintaining incremental counters (updated on state changes) to avoid full iteration on each stats query.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b50599b and db2a71b.

📒 Files selected for processing (2)
  • contracts/market-place-contract/src/contract.rs (13 hunks)
  • contracts/staking/src/lib.rs (9 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • contracts/staking/src/lib.rs
🧰 Additional context used
🧬 Code graph analysis (1)
contracts/market-place-contract/src/contract.rs (2)
contracts/market-place-contract/src/storage.rs (13)
  • get_next_nft_id (62-67)
  • get_nft (71-74)
  • set_nft (76-79)
  • add_creator_nft (88-93)
  • add_owner_nft (100-105)
  • add_category_nft (121-126)
  • add_all_nft_id (135-139)
  • remove_owner_nft (107-114)
  • get_all_nft_ids (128-133)
  • get_nft_counter (58-60)
  • get_owner_nfts (95-98)
  • get_category_nfts (116-119)
  • get_creator_nfts (83-86)
contracts/market-place-contract/src/events.rs (4)
  • emit_nft_created (40-56)
  • emit_nft_sold (58-74)
  • emit_nft_price_updated (76-90)
  • emit_nft_availability_toggled (92-104)
🔇 Additional comments (9)
contracts/market-place-contract/src/contract.rs (9)

3-6: LGTM! Clean import organization.

The imports are well-organized with explicit types. The alias other_get_nft appropriately avoids naming collision with the public get_nft function.


16-16: Price type correctly migrated to i128.

The price parameter now uses i128, aligning with Soroban's token amount type and addressing the previous review feedback.


23-39: LGTM! Well-structured NFT initialization.

The NFT construction is complete with all required fields, proper typing (u64 for IDs and timestamps, i128 for price), and correct initialization of status and temporal fields.


76-77: Cast removed as price is now i128.

The token transfer correctly uses nft.price directly without casting, as the field is now i128 throughout. This addresses the previous review feedback.


66-99: LGTM! Ownership transfer logic is sound.

The buy flow properly:

  • Validates NFT availability and ownership
  • Transfers tokens using the typed token client
  • Updates ownership records in storage
  • Sets sold status and timestamp
  • Emits the appropriate event

106-126: LGTM! Price update flow is correct.

The function properly validates creator ownership and price validity, updates the NFT with the new i128 price, and emits an event capturing both old and new values.


129-154: LGTM! Availability toggle logic is sound.

The function correctly:

  • Validates creator ownership
  • Toggles between Available/Unavailable states
  • Prevents toggling sold NFTs
  • Derives the boolean flag idiomatically with matches!
  • Emits the appropriate event

159-161: LGTM! Clean error handling.

The function appropriately delegates to the storage layer and maps None to a domain error, providing a clean public API.


164-217: LGTM! Consistent read-only query pattern.

All NFT query functions follow a clean, consistent pattern:

  • Fetch ID lists from storage
  • Iterate and resolve each ID to an NFT
  • Gracefully skip missing entries
  • Return typed Vec<NFT>

The explicit type annotations improve code clarity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant