Devnet testing suite and Rhai activation_url support #26

Merged
scott merged 2 commits from main-testing into main 2026-01-30 22:42:28 +00:00
Owner

What

Add automated devnet testing infrastructure and expose the activation service to the Rhai scripting API.

Changes

Rhai API enhancement (src/rhai/account/manager.rs, src/rhai/account/mod.rs)

  • Expose activation_url() as a chainable method on AccountManager in Rhai
  • Auto-populate activation URL from chain config in get_internal() when not explicitly set
  • heroledger_network("dev"); account("name").create().get() now automatically uses the devnet activation service -- no hardcoded URLs, no CLI workaround needed
  • Explicit .activation_url("http://...") override still available for custom setups
  • Zero SDK changes -- purely additive in the Rhai bridge layer

Devnet test suite (rhaitests/devnet/)

  • test_smoke_devnet.rhai -- Read-only verification of all 10 devnet contracts (SPORE, GLD, USDH, SPOREX, KVS, DNS, Credit, Groups, Hosting, Faucet)
  • test_devnet_account.rhai -- Self-contained account lifecycle test: creates account, activates on-chain via activation service, verifies existence/balance, queries contracts, cleans up

Documentation (docs/DEVNET_TESTING.md)

  • Prerequisites (system packages, Rust toolchain, Redis, cargo-near)
  • Two-stage build process (WASM contracts then CLI)
  • Manual CLI testing flow
  • Rhai test suite usage and authoring guide
  • Devnet vs local comparison
  • Troubleshooting

Testing

Test Result
cargo build Clean
cargo test -p heroledger --lib 74 passed, 0 failed
Rhai devnet smoke (10 contracts) 10/10
Rhai devnet account (self-contained) 11/11
CLI manual flow (create/activate/info/list) All pass
### What Add automated devnet testing infrastructure and expose the activation service to the Rhai scripting API. ### Changes **Rhai API enhancement** (`src/rhai/account/manager.rs`, `src/rhai/account/mod.rs`) - Expose `activation_url()` as a chainable method on `AccountManager` in Rhai - Auto-populate activation URL from chain config in `get_internal()` when not explicitly set - `heroledger_network("dev"); account("name").create().get()` now automatically uses the devnet activation service -- no hardcoded URLs, no CLI workaround needed - Explicit `.activation_url("http://...")` override still available for custom setups - Zero SDK changes -- purely additive in the Rhai bridge layer **Devnet test suite** (`rhaitests/devnet/`) - `test_smoke_devnet.rhai` -- Read-only verification of all 10 devnet contracts (SPORE, GLD, USDH, SPOREX, KVS, DNS, Credit, Groups, Hosting, Faucet) - `test_devnet_account.rhai` -- Self-contained account lifecycle test: creates account, activates on-chain via activation service, verifies existence/balance, queries contracts, cleans up **Documentation** (`docs/DEVNET_TESTING.md`) - Prerequisites (system packages, Rust toolchain, Redis, cargo-near) - Two-stage build process (WASM contracts then CLI) - Manual CLI testing flow - Rhai test suite usage and authoring guide - Devnet vs local comparison - Troubleshooting ### Testing | Test | Result | |---|---| | `cargo build` | Clean | | `cargo test -p heroledger --lib` | 74 passed, 0 failed | | Rhai devnet smoke (10 contracts) | 10/10 | | Rhai devnet account (self-contained) | 11/11 | | CLI manual flow (create/activate/info/list) | All pass
scott force-pushed main-testing from fab0b8254e to 8370673080
Some checks failed
Test / build-and-test (pull_request) Failing after 26s
Test / build-and-test (push) Has been cancelled
2026-01-30 22:41:40 +00:00
Compare
scott merged commit 39c87d9e9d into main 2026-01-30 22:42:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
urgent
No milestone
No project
No assignees
2 participants
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
lhumina_code/hero_ledger!26
No description provided.