Deterministic test adapter which wraps a real ledger Store.
The mock never reimplements ledger semantics. Unscripted calls are delegated to the configured Store, while scripted calls can replace a reply before the delegate runs or after it has run. The latter is useful for simulating a lost acknowledgement after a durable commit.
Scripts contain {operation, phase, reply} tuples. Supported operations are
:append, :load, :lookup_batch, and :export; phases are :before and
:after. Append scripts cannot synthesize a successful commit, and an
after-append reply is used only when the delegate really succeeded. Each
operation consumes its own script in insertion order.
Summary
Functions
Returns delegated calls in execution order.
Returns a specification to start this module under a supervisor.
Appends validated fault actions to the running script.
Starts a mock around the required :store adapter configuration.
Types
Functions
@spec calls(GenServer.server()) :: [map()]
Returns delegated calls in execution order.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec push(GenServer.server(), action() | [action()]) :: :ok | {:error, term()}
Appends validated fault actions to the running script.
@spec start_link(keyword()) :: GenServer.on_start()
Starts a mock around the required :store adapter configuration.