What lives here
tests/ holds the LiteSVM program tests, the integration tests and the callback-consumer program that proves a callback can be received. tests/fixtures/pda-seeds.json pins the seeds that the programs and both SDKs share. tests/adversarial/README.md is the checklist drawn from the threat model.
“The tests that exist today only assert that the closed paths stay closed.”
That sentence is the opening for new work: each threat-model row names an outcome an attacker wants, and most of them have no test behind them yet.
A first contribution
- Turn a row of the adversarial checklist into a test: a forged proof, a replayed alpha, a second fulfilment, a heartbeat outside the window.
- Assert a timing bound exactly: cancel requires slot < expires_slot and expire requires slot >= expires_slot.
- Test a callback that always fails, and check that the transaction reverts and the request is not left fulfilled.
- Make a flaky or slow test deterministic rather than deleting it.
Checks that must pass
Every pull request to the protocol repository has to pass one command:
make checkThat runs formatting, Clippy, cargo build-sbf for the three programs and the test callback consumer, the Rust tests and the JavaScript SDK tests. Program tests load target/deploy/*.so, so the Solana CLI and the platform tools have to be installed.
- Program tests load target/deploy/*.so, so run the build before the tests in a clean checkout.
- A test that passes because an instruction is missing is not a passing test. Say which absence it asserts.
- scripts/deploy-mainnet.sh must keep refusing to run.
Decisions that are closed
- Reward and challenge paths have no instructions, so there is nothing to test there yet.
- ADR 0003: the cooldown and the heartbeat window must each be in 1..=150_000, which is the existing request-timeout bound and not a chosen duration.
- A test must not relax an assertion to accommodate a new feature that has no decision record.
- Fixtures are the shared source for seeds. A test that hardcodes a seed is a regression.
On this page