Skip to main content

Module mock

Module mock 

Source
Expand description

Deterministic mock transport.

mock://<name> URLs address an in-memory mock transport whose behavior is fully controlled by the test harness. Two peers sharing a name exchange byte vectors through an internal channel (like inproc), but the mock layer can be configured to:

  • drop messages (simulating a message-losing network or a Byzantine peer that withholds input),
  • tamper messages (flipping bytes to simulate an active adversary),
  • record every sent and received byte for post-hoc assertion.

This is the transport for deterministic CI vectors and replay-attack tests described in TODO #05.

Structsยง

MockConfig
Fault-injection knobs for a mock channel.
MockKind
MockListener
MockTransport
Connected mock transport. All traffic is recorded for assertion.