testing library

The pool's test chain, for packages built on tstokenlib.

A wallet, a coordinator server or a tool cannot be tested against a real pool without proving one, and a pool proved at production parameters takes minutes on a machine with a GPU. PoolChainFixture proves a two-round pool at PoolTestParams in a few seconds: a deposit, a payment to a wallet the caller holds the keys of, a withdrawal, real notes with real ciphertexts, and headers a ledger applies.

PoolTestChain takes that fixture and builds the two rounds as transactions — issuance, witness 0, the slots, the depositor's covenant, and both rounds with their witnesses — which is what a wallet or a server actually reads. PoolTestKeys holds the published regtest keys it is built from, so the chain comes out byte-identical everywhere.

This is a separate entry point so nothing here is pulled into a wallet that only imports tstokenlib.dart.

Classes

PoolChainFixture
The proofs and headers of a pool's first two rounds, with the real V: round 1 takes in a deposit of 500 through receipt slot 0 beside padding transfers, and round 2 spends that note into a 200 note and a withdrawal of 300 to withdrawalPKH. At test parameters (4 transfers, 2 receipt slots) unless production, which proves the 256-transfer throughput plan with nullifiers and 8 receipt slots, as the pool runs it. Nothing here is a transaction; pool_round_v_test builds the chain in memory and pool_localnet_test builds it on a node, both from this.
PoolTestChain
The fixture's two rounds as transactions, built the way pool_round_v_test builds them: issuance R0, witness W0, slots Y0 to Y2, the depositor's covenant D, rounds R1 and R2 and their witnesses. Nothing here runs a script; the round V test does that for the same chain.
PoolTestKeys
The keys and funding the test chain is built from.
PoolTestParams
The STARK parameters the test chain proves at: small enough to prove in seconds, the same shape as production. A pool run on these is not sound; they exist so the chain, the reader, the coordinator and a wallet can be exercised end to end without a prover farm.

Typedefs

TestPlacement = ({List<int> blockHash, List<List<int>> branch, int txIndex}) Function(int round, Transaction witness)
Where the test chain's round round has its witness mined: the block, the witness's index in it and its merkle branch.