Skip to main content

protocol/testing/arbitraries

packages/protocol/src/testing/arbitraries

Purpose

Public barrel for schema-derived protocol arbitraries used by tests.

Public surface

allRpcMethods

Variable
Ordered list of every wire method name. Exposed so properties can assert “every method exercised at least once” without going through RpcMap directly.

arbitraryAnyCall

Function
Arbitrary that draws any method name + matching params. Used by the RpcMap-coverage property and the cross-RPC fuzz property.

arbitraryCallFor

Function
Arbitrary of a valid params tree for a single, fixed RPC.

arbitraryFromSchema

Function
Derive an Arbitrary<Schema.Schema.Type<S>> for any Effect Schema. The derivation is pure: given the same schema + fast-check seed, it yields the same value tree (AC10 reproducibility). The return type is Effect’s re-exported FastCheck.Arbitrary — the SAME fast-check module the rest of the suite samples with (both pinned to fast-check v3, the version Effect’s Arbitrary.make binds to), so no cross-module cast is needed.

ArbitraryRpcCall

Interface
A single drawn RPC invocation: the method name selects the wire definition and the params tree is drawn from that definition’s schema.

Files

  • rpc.ts
  • schema-arbitrary.ts