ResQ.Blockchain
MockNeoClient Class
Mock implementation of INeoClient for testing and development.Example
Remarks
This mock client provides an in-memory implementation of the Neo N3 blockchain interface, suitable for unit testing and local development without requiring a real blockchain connection. All operations succeed immediately and generate deterministic fake transaction hashes. Events are stored in memory and can be retrieved by incident ID. Block height increments with each transaction. No actual blockchain transactions are performed.| Constructors | |
|---|---|
| MockNeoClient(ILogger<MockNeoClient>) | Initializes a new instance of the MockNeoClient class. |
| Methods | |
|---|---|
| ExtractIncidentId(string) | Extracts an incident ID from a JSON payload string. |
| GenerateTxHash() | Generates a random transaction hash for mock purposes. |
| GetBlockHeightAsync(CancellationToken) | Gets the current mock block height. |
| GetEventsByIncidentAsync(string, CancellationToken) | Retrieves mock events by incident ID from the in-memory store. |
| RecordEventAsync(BlockchainEvent, CancellationToken) | Records a mock blockchain event in memory. |
| RecordEvidenceAsync(EvidenceRecord, CancellationToken) | Records mock evidence metadata in memory. |
| RecordLocationAttestationAsync(LocationAttestation, CancellationToken) | Records a mock location attestation in memory. |
| VerifyLocationAttestationAsync(LocationAttestation, CancellationToken) | Verifies a location attestation in mock mode. |