Skip to main content

Module locking

Module locking 

Source
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 proptest strategy over sequences of LockOp for a wallet holding n_notes notes.
check_note_locking_model
Model-based test of the note-locking storage operations.
clear_locked_outputs
Verifies that OutputLockStore::clear_locked_outputs unlocks 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 the unlock_output return-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 PreferUnlocked or PreferLocked admits both tiers, the single oldest covering note can come from the NON-preferred tier — in particular, PreferUnlocked could 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_policy actually reaches note selection in GreedyInputSelector::propose_transaction, end to end.
transparent_note_lockingtransparent-inputs
Exercises note locking for transparent outputs.
unlock_proposal_inputs_releases_locks
Verifies that unlock_proposal_inputs releases the locks taken by a proposal created with a LockRequest, restoring spendability for a subsequent proposal (the abandoned-proposal recovery path), and that the release is scoped to the owner that took the locks.