Skip to content

Latest commit

 

History

History
73 lines (51 loc) · 3 KB

File metadata and controls

73 lines (51 loc) · 3 KB

Pull Request: Fix Multiple Build Errors in CraftNexus Contract

Issue(s)

  • Closes #627

Summary

This PR resolves multiple critical build errors in the CraftNexus Soroban smart contract, making the codebase buildable and testable again.


Context and Background

cargo check --tests reported build errors at multiple locations:

  1. Cannot find macro 'vec' in this scope (lines 339 and 437 of min_release_window_test.rs)

    • The test file uses vec![] macro but had not imported soroban_sdk::vec
    • Important note: In no‑std crates like Soroban contracts, soroban_sdk::vec shadows the standard library's vec! macro
  2. E0609 no field on Option (lines 2559, 2567, 2584, 2592, 2601, 2609 of test.rs)

  3. E0599 no method to_string (lines 2149, 2255, 3395 of onboarding.rs)

  4. E0382 moved value (line 68 of expired_dispute_fee_test.rs)

  5. Unclosed delimiter (line 2157 of onboarding_test.rs)


Impact and Severity

Field Value
Category Bug / Build Blocker
Impact Level High (prevents any builds or tests from passing)

Changes Made

Here are the specific fixes applied:

  1. min_release_window_test.rs: Added use soroban_sdk::vec; at the top of the file
  2. test.rs: Added .unwrap() before accessing .1 and .2 on Option values
  3. onboarding.rs: Added use crate::alloc::string::ToString;
  4. expired_dispute_fee_test.rs: Added .clone() before first move at line 68
  5. onboarding_test.rs: Added missing closing } at line 2157

Validation

  • cargo check --tests passes with zero errors
  • cargo test passes all test suites
  • cargo build --target wasm32-unknown-unknown --release succeeds
  • Snapshot files are unchanged or intentionally updated
  • PR description references the relevant issue number
  • Documentation is updated (if applicable)

PR Checklist

  • I have read the contributing guidelines
  • My code follows the project's style guidelines
  • I have performed a self‑review of my code
  • All existing tests pass
  • Code is properly formatted and linted

Critical Prerequisite Followed

  • Ensured cargo check --tests passes before submitting this PR

Additional Context