Expand description
Neo N3 Contract Testing Framework
This crate provides utilities for testing Neo N3 smart contracts with a mock runtime environment.
§Usage
ⓘ
use neo_test::*;
// Create a test environment
let mut env = TestEnvironment::new();
// Set up contract state
env.set_storage(b"owner", b"AV4GGdKS2C7j1GqC3w5y4qX5");
// Add witness
env.add_witness(b"AV4GGdKS2C7j1GqC3w5y4qX5");
// Assert
env.assert_storage().assert_contains(b"owner");
env.assert_runtime().assert_witness(b"AV4GGdKS2C7j1GqC3w5y4qX5");Macros§
Structs§
- Contract
Test - Method
Call Result - Result of a contract method call for assertions
- Mock
Runtime - Mock runtime for testing contract execution
- Mock
Runtime Builder - Builder for creating mock runtime
- Mock
Storage - Mock storage that simulates Neo blockchain storage
- Mock
Storage Context - Mock storage context for simulating storage operations
- Runtime
Assertions - Runtime assertions
- Storage
Assertions - Storage assertions
- Test
Builder - Test
Environment - Test environment for Neo N3 contract testing
- Test
Error