- Closes #627
This PR resolves multiple critical build errors in the CraftNexus Soroban smart contract, making the codebase buildable and testable again.
cargo check --tests reported build errors at multiple locations:
-
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 importedsoroban_sdk::vec - Important note: In no‑std crates like Soroban contracts,
soroban_sdk::vecshadows the standard library'svec!macro
- The test file uses
-
E0609 no field on Option (lines 2559, 2567, 2584, 2592, 2601, 2609 of test.rs)
-
E0599 no method to_string (lines 2149, 2255, 3395 of onboarding.rs)
-
E0382 moved value (line 68 of expired_dispute_fee_test.rs)
-
Unclosed delimiter (line 2157 of onboarding_test.rs)
| Field | Value |
|---|---|
| Category | Bug / Build Blocker |
| Impact Level | High (prevents any builds or tests from passing) |
Here are the specific fixes applied:
- min_release_window_test.rs: Added
use soroban_sdk::vec;at the top of the file - test.rs: Added
.unwrap()before accessing.1and.2onOptionvalues - onboarding.rs: Added
use crate::alloc::string::ToString; - expired_dispute_fee_test.rs: Added
.clone()before first move at line 68 - onboarding_test.rs: Added missing closing
}at line 2157
-
cargo check --testspasses with zero errors -
cargo testpasses all test suites -
cargo build --target wasm32-unknown-unknown --releasesucceeds - Snapshot files are unchanged or intentionally updated
- PR description references the relevant issue number
- Documentation is updated (if applicable)
- 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
- Ensured
cargo check --testspasses before submitting this PR