The suite is intentionally split by purpose.
File:
tests/cvct.smoke.ts
Covers:
- math vectors
- init
- one happy deposit
- one happy redeem
- one happy transfer
- zero-amount guards
- invariant sanity
Use this for fast local iteration.
File:
tests/cvct.lifecycle.ts
Covers:
- callback staging behavior
- early-settle rejection
- invalid quote failure
- cancel / expire
- idempotent settle behavior
- cleanup success and cleanup rejection
File:
tests/cvct.races.ts
Covers:
- competing operation invalidation
- changed-sync invalidation
- transfer-vs-staged-op invalidation
- overlapping transfer snapshots
- failed transfer behavior
- cleanup for invalidated operations
File:
tests/kamino_adapter.ts
Covers:
- adapter config
- invalid wiring rejection
- inline deposit rebalance
- manual deposit / withdraw escape hatches
- disabled adapter behavior
- buffered low-liquidity redeem auto-withdraw
- adapter sync behavior
yarn testyarn test:cvctCVCT_RUN_KAMINO_LOCAL=1 yarn test:kaminoCVCT_RUN_KAMINO_LOCAL=1 arcium testThe expensive part is not TypeScript itself. It is the local integration stack:
- Solana local validator
- Arcium nodes
- callback-visible MPC flows
- Kamino CPI setup and treasury movement
That means many tests are waiting on:
- computation finalization
- callback-observable state
- canonical balance or settlement visibility
The suite is intentionally integration-heavy because the protocol’s hardest bugs are sequencing and concurrency bugs.
The helpers are split by responsibility.
Environment and fixture creation.
Flow helpers and scenario builders.
Polling, fetchers, and assertions.
Shared low-level implementation behind the public helper surface.
CVCT_DEBUG_RPC_LOGS=1 yarn test:cvctCVCT_DEBUG_TIMINGS=1 yarn test:cvctUse this default workflow:
yarn testwhile iterating on straightforward logicyarn test:cvctbefore pushing protocol changesCVCT_RUN_KAMINO_LOCAL=1 arcium testbefore merge or release-level validation
Cleanup tests should prove success by:
- account closed
- lamports returned to owner
They should not prove cleanup by sending a second instruction against a closed PDA. That tends to produce transport noise rather than useful signal.