Skip to main content

Crate neo_runtime

Crate neo_runtime 

Source
Expand description

Neo N3 Runtime facade

This crate provides a lightweight façade over the Neo runtime surface so integration tests and examples can exercise the canonical syscall catalogue without depending on a full node implementation. The implementation intentionally returns deterministic placeholder values – enough to validate wiring and type conversions while remaining self-contained for unit tests.

§⚠️ Contract panic safety

In Neo N3, a runtime panic (panic!, unwrap() on None/Err, index out of bounds, arithmetic overflow) causes the VM to FAULT, which reverts the entire transaction. Unlike off-chain Rust, you cannot use panics for control flow in on-chain contracts. Always use NeoResult<T> and explicit error handling. The #[neo_contract] macro expects methods to return NeoResult<T> precisely because panics are unrecoverable on-chain.

Re-exports§

pub use contract_caller::call_typed;
pub use contract_caller::ContractCallError;
pub use contract_caller::DefaultContractCaller;

Modules§

contract_caller
L9: typed cross-contract calls via the ContractCaller trait.

Structs§

NeoContractRuntime
Neo N3 contract management operations.
NeoCrypto
Crypto helpers for Neo N3 smart contracts.
NeoJSON
Minimal JSON helpers to support tests.
NeoRuntime
Direct wrappers for the canonical System.Runtime syscalls.
NeoRuntimeContext
Lightweight view of the runtime context.
NeoStorage
Storage convenience helpers built on top of the syscall layer.
RawKeyBuilder
Fixed-capacity stack key builder for RawStorage keys.
RawStorage
Heap-free storage facade that operates on &[u8] slices.

Enums§

RawStorageGet
Outcome of RawStorage::get_into.