Expand description
Testing utilities for choreographic protocols
This module provides building blocks for protocol testing, simulation, and integration with external simulators like aura-simulator.
§Overview
The testing module provides:
- Deterministic execution:
ClockandRngtraits for reproducible runs - State machines:
ProtocolStateMachinefor step-by-step execution - Transport abstraction:
SimulatedTransportfor custom message delivery - Event observation:
ProtocolObserverfor monitoring protocol execution - Message envelopes:
ProtocolEnvelopefor structured message passing
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ Simulator / Test Harness │
└─────────────────────────────────────────────────────────────┘
│
┌──────────────────┼──────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Clock │ │ Rng │ │ Observer │
│ Trait │ │ Trait │ │ Trait │
└─────────────┘ └─────────────┘ └─────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ ProtocolStateMachine │
│ blocked_on() -> BlockedOn │
│ step(input) -> StepOutput │
│ checkpoint() / restore() │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ SimulatedTransport │
│ send(to, envelope) -> Result │
│ recv(from) -> Result<Envelope> │
└─────────────────────────────────────────────────────────┘Re-exports§
pub use clock::AsyncClock;pub use envelope::ProtocolEnvelope;pub use observer::NullObserver;pub use observer::ProtocolObserver;pub use observer::RecordingObserver;pub use state_machine::BlockedOn;pub use state_machine::Checkpoint;pub use state_machine::ProtocolStateMachine;pub use state_machine::StepInput;pub use state_machine::StepOutput;pub use transport::AsyncSimulatedTransport;pub use transport::InMemoryTransport;pub use transport::SimulatedTransport;pub use transport::TransportError;
Modules§
- clock
- Clock and RNG traits for deterministic simulation.
- envelope
- Protocol message envelope for structured message passing
- observer
- Protocol observer trait for monitoring execution
- state_
machine - Protocol state machine for step-by-step simulation
- transport
- Simulated transport traits for protocol execution