Skip to content

Expose property-based testing helpers as public API#249

Open
BowTiedRadone wants to merge 1 commit intomasterfrom
lib/simnet-pbt
Open

Expose property-based testing helpers as public API#249
BowTiedRadone wants to merge 1 commit intomasterfrom
lib/simnet-pbt

Conversation

@BowTiedRadone
Copy link
Copy Markdown
Contributor

@BowTiedRadone BowTiedRadone commented Apr 14, 2026

Clarity smart contracts benefit from property-based testing, but setting up fast-check arbitraries that produce valid Clarity values for every parameter type (uint, principal, buffers, lists, tuples, optionals, responses, trait references) is tedious and error-prone. Rendezvous already solves this internally; this PR exposes that capability as a library API so the community can use it off-the-shelf.

Two new exports:

  • getContractFunction(simnet, contract, fn, deployer?): extracts a function interface from a deployed contract, enriched with trait data
  • generateArgs(fn, simnet) — returns fc.Arbitrary<ClarityValue[]>, handling all Clarity types including recursive structures (list of tuples, optional of response, etc.) and trait reference resolution

The package now works as both a CLI (npx rv) and a library (import { generateArgs } from "@stacks/rendezvous"). TypeScript declarations are included.

Fixes #168.

@BowTiedRadone BowTiedRadone requested a review from a team as a code owner April 14, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export random argument generation and ClarityValue conversion

1 participant