Available on crate features
test-dependencies only.Expand description
The shared, backend-agnostic test suite for the note-locking feature.
Every scenario here is generic over a ShieldedPoolTester (or a
DataStoreFactory for the transparent scenario) and is instantiated per
pool by the concrete backends (see zcash_client_sqlite). The semantics
under test are specified in crate::data_api::locking.
Enums§
- LockOp
- An operation in the note-locking model test; see
check_note_locking_model.
Functions§
- arb_
lock_ ops - A
propteststrategy over sequences ofLockOpfor a wallet holdingn_notesnotes. - check_
note_ locking_ model - Model-based test of the note-locking storage operations.
- clear_
locked_ outputs - Verifies that
OutputLockStore::clear_locked_outputsunlocks every locked output for an account regardless of expiry height, as required by the lost-proposal recovery path. - explicit_
note_ locking - lock_
conflict_ and_ batch_ atomicity - Exercises lock-conflict detection and the all-or-nothing batch contract of
OutputLockStore::lock_outputs, along with theunlock_outputreturn-value semantics. - lock_
expiry_ restores_ spendability - Exercises the passed-expiry semantics of note locking under chain advance.
- locked_
proposal_ proto_ roundtrip - Verifies that a proposal created with
lock_for_blocks: Some(_)round-trips through its serialized (proto) form. - note_
locking_ height_ boundary - Exercises the exact height boundary of the note-locking semantics.
- proposal_
level_ note_ locking - single_
note_ selection_ honors_ lock_ tier_ preference - Single-note selection preserves the caller’s lock-tier preference: the lock tier is the
primary sort key and chain age the secondary, matching the accumulation path’s window order.
Without this, when
PreferUnlockedorPreferLockedadmits both tiers, the single oldest covering note can come from the NON-preferred tier — in particular,PreferUnlockedcould reuse an acknowledged in-flight locked input merely because it is older than an unlocked alternative. - spend_
fails_ on_ locked_ notes - spend_
policy_ locked_ input_ policy_ reaches_ selection - Verifies that
SpendPolicy::with_locked_input_policyactually reaches note selection inGreedyInputSelector::propose_transaction, end to end. - transparent_
note_ locking transparent-inputs - Exercises note locking for transparent outputs.
- unlock_
proposal_ inputs_ releases_ locks - Verifies that
unlock_proposal_inputsreleases the locks taken by a proposal created with aLockRequest, restoring spendability for a subsequent proposal (the abandoned-proposal recovery path), and that the release is scoped to the owner that took the locks.