Documentation, Tests, and Code Quality Improvements #1

Merged
mik-tf merged 9 commits from master-tests into master 2026-01-01 22:33:01 +00:00
Contributor

Description

This PR significantly improves the hero_near project's documentation, test coverage, and code quality.


Summary of Changes

31 files changed, +3,352 lines, -445 lines


📚 New Documentation (6 README files)

File Lines Description
contract/credit/README.md 328 Pull-based billing system, rate limits, usage examples
crates/rhai-near/README.md 192 Scripting API reference, modules, quick start guide
setup/README.md 126 heronear CLI, deployment modules, usage
examples/README.md 147 DNS examples walkthrough, pricing reference
scripts/README.md 145 Operational scripts guide, templates

📝 Documentation Updates

File Changes
README.md Major rewrite (+946 lines) - comprehensive TOC, architecture, CLI usage
SETUP.md Major rewrite (+890 lines) - step-by-step guide, troubleshooting

🧪 New Tests (+719 lines)

File Tests Description
crates/rhai-near/tests/integration_tests.rs 24 Context, operators, error handling
crates/rhai-near/tests/rhai_scripts_test.rs 31 Validates all Rhai scripts

Test Results: 100 passed, 0 failed, 0 ignored


🔧 Bug Fixes & Code Quality

Setup Pipeline Fixes

  • setup.sh: Auto-build neard from source when not installed (+145 lines)
  • setup/src/blockchain.rs: Added contract_is_initialized() check (+73 lines)
  • Fixed WASM paths from ./target/wasm32.../ to ./target/near/

Compiler Warning Fixes

File Fix
contract/groups/src/lib.rs Moved unused NearToken import to tests module
contract/groups/src/types.rs Changed gen to _gen (unused variable)
contract/credit/src/events.rs Removed unused emit_event re-export
contract/dns/src/auction.rs Removed empty use super::*;
contract/dns/src/domain.rs Removed empty use super::*;
setup/src/setup.rs Added #[allow(dead_code)] for WASM constants

Doc-test Fixes

File Fix
contract/dns/src/model.rs Changed rust,ignore to text
contract/kvs/src/validation.rs Changed rust,ignore to text

Verification

  • All code compiles without warnings
  • All 100 tests pass (0 ignored)
  • All 31 Rhai scripts validated
  • Setup pipeline works end-to-end
  • All 8 contracts have README.md files

Breaking Changes

None


Closes documentation gap for credit vault, rhai-near, setup, examples, and scripts directories.

### Description This PR significantly improves the hero_near project's documentation, test coverage, and code quality. --- ### Summary of Changes **31 files changed, +3,352 lines, -445 lines** --- ### 📚 New Documentation (6 README files) | File | Lines | Description | |------|-------|-------------| | `contract/credit/README.md` | 328 | Pull-based billing system, rate limits, usage examples | | `crates/rhai-near/README.md` | 192 | Scripting API reference, modules, quick start guide | | `setup/README.md` | 126 | heronear CLI, deployment modules, usage | | `examples/README.md` | 147 | DNS examples walkthrough, pricing reference | | `scripts/README.md` | 145 | Operational scripts guide, templates | ### 📝 Documentation Updates | File | Changes | |------|---------| | `README.md` | Major rewrite (+946 lines) - comprehensive TOC, architecture, CLI usage | | `SETUP.md` | Major rewrite (+890 lines) - step-by-step guide, troubleshooting | --- ### 🧪 New Tests (+719 lines) | File | Tests | Description | |------|-------|-------------| | `crates/rhai-near/tests/integration_tests.rs` | 24 | Context, operators, error handling | | `crates/rhai-near/tests/rhai_scripts_test.rs` | 31 | Validates all Rhai scripts | **Test Results: 100 passed, 0 failed, 0 ignored** --- ### 🔧 Bug Fixes & Code Quality #### Setup Pipeline Fixes - `setup.sh`: Auto-build neard from source when not installed (+145 lines) - `setup/src/blockchain.rs`: Added `contract_is_initialized()` check (+73 lines) - Fixed WASM paths from `./target/wasm32.../` to `./target/near/` #### Compiler Warning Fixes | File | Fix | |------|-----| | `contract/groups/src/lib.rs` | Moved unused `NearToken` import to tests module | | `contract/groups/src/types.rs` | Changed `gen` to `_gen` (unused variable) | | `contract/credit/src/events.rs` | Removed unused `emit_event` re-export | | `contract/dns/src/auction.rs` | Removed empty `use super::*;` | | `contract/dns/src/domain.rs` | Removed empty `use super::*;` | | `setup/src/setup.rs` | Added `#[allow(dead_code)]` for WASM constants | #### Doc-test Fixes | File | Fix | |------|-----| | `contract/dns/src/model.rs` | Changed `rust,ignore` to `text` | | `contract/kvs/src/validation.rs` | Changed `rust,ignore` to `text` | --- ### ✅ Verification - [x] All code compiles without warnings - [x] All 100 tests pass (0 ignored) - [x] All 31 Rhai scripts validated - [x] Setup pipeline works end-to-end - [x] All 8 contracts have README.md files --- ### Breaking Changes None --- ### Related Issues Closes documentation gap for credit vault, rhai-near, setup, examples, and scripts directories.
mik-tf changed title from docs: Update README and SETUP with comprehensive documentation to Test Suite and Neard Updates 2026-01-01 22:07:49 +00:00
mik-tf changed title from Test Suite and Neard Updates to Documentation, Tests, and Code Quality Improvements 2026-01-01 22:32:35 +00:00
mik-tf merged commit 077590da8d into master 2026-01-01 22:33:01 +00:00
mik-tf deleted branch master-tests 2026-01-01 22:33:02 +00:00
Sign in to join this conversation.
No reviewers
No labels
urgent
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_research/hero_ledger!1
No description provided.