Available on crate features
test-dependencies only.Re-exports§
pub use locking::*;
Modules§
- dsl
- A convenient DSL for writing wallet tests.
- locking
- The shared, backend-agnostic test suite for the note-locking feature.
Enums§
- Boundary
Scan Order orchard - The order in which
retained_boundaries_below_window_are_usable_anchorsscans the batch that holds the anchor-retention boundaries. - Input
Trust - An enumeration of mechanisms for generating transaction inputs for confirmations policy testing.
Traits§
- Shielded
Pool Tester - Trait that exposes the pool-specific types and operations necessary to run the single-shielded-pool tests on a given pool.
Functions§
- account_
deletion - account_
deletion_ with_ internal_ transfer - Regression test for a bug in which
WalletWrite::delete_accountfailed with arusqlite::Error::InvalidParameterName(":address")panic when the account being deleted was referenced by asent_notesrow via itsto_account_idcolumn. - account_
rename - Verifies that
WalletWrite::set_account_namereplaces the name of the given account, leaves the names of other accounts unchanged, and permits two accounts to share a name. - anchor_
checkpoints_ retained_ across_ deep_ scan - A wallet-level test for note-commitment-tree anchor retention: once NU6.3 (Ironwood) is
active, checkpoints on the anchor-retention interval are retained as durable anchors, exempt
from the ordinary
PRUNING_DEPTH-checkpoint pruning budget, so that their roots and the witnesses anchored to them remain computable even after they age far behind the chain tip. - anchor_
is_ policy_ depth_ state_ or_ absent - The anchor for a new transaction is the tree state
trustedconfirmations below the target, or absent. The wallet never substitutes an older tree state: an anchor older than the policy depth would publish, on chain, how far behind the tip the wallet was when it spent. Every height within the pruning window is checkpointed, so scanned empty blocks do not move the anchor below the policy depth. - b_
note_ stable_ across_ rewind_ below_ birthday - A note in the chain-tip shard stays recoverable across a rewind to below its account’s birthday, as long as the chain has real history there to re-scan.
- birthday_
in_ anchor_ shard - canonical_
crossing_ abandoned_ without_ anchor_ checkpoint orchard - A canonical payment whose bucketed anchor checkpoint is MISSING from the wallet falls back to an ordinary crossing instead of failing at build time.
- canonical_
crossing_ builds_ at_ empty_ boundary_ block orchard - A canonical crossing whose bucketed anchor falls on a block with no shielded outputs must still build. Note eligibility at the bucketed anchor is a height comparison, so the proposal selects and anchors there regardless; unless the boundary checkpoint was ensured at scan time — the boundary block itself contributed no note commitment to create one — building would fail attempting to construct witnesses at a checkpoint that does not exist.
- canonical_
crossing_ fee_ follows_ marginal_ fee_ at_ target_ height orchard - A canonical ZIP 318 crossing pays the canonical fee in effect at its target height
(
fees::canonical_crossing_fee): the fee before the fee reduction height of ZIP 2009 when it targets the block before it, even if built after the chain has crossed it, and the reduced fee from it. - canonical_
crossing_ is_ bucketed_ and_ unpadded orchard - A payment whose value is a canonical ZIP 318 denomination, fundable from a single Orchard note, is proposed against a bucketed anchor and built with a single unpadded Ironwood action — the shape of a ZIP 318 migration transfer. Everything else keeps the ordinary anchor and the two-action floor.
- canonical_
crossing_ prefers_ single_ note orchard - A canonical payment is funded from the single oldest covering note even when accumulation would have reached the target through several smaller notes first.
- change_
note_ spends_ succeed - checkpoint_
gaps - A gap in scanned coverage directly below the policy depth withholds the anchor: the wallet cannot know that its latest checkpoint carries the tree state at that depth. Scanning the gap restores the anchor without any new checkpoint, since the gap’s blocks add no commitments.
- coinbase_
only_ filtering pcztandtransparent-inputs - Tests that
CoinbaseFilter::CoinbaseOnlyexcludes non-coinbase outputs andCoinbaseFilter::NonCoinbaseOnlyexcludes coinbase outputs from UTXO selection and shielding proposals, and thatCoinbaseOnlystill allows proposing shielding when only coinbase UTXOs are available. - completed_
shard_ note_ spendable_ across_ older_ birthday_ import - Importing an account whose birthday lies below the wallet birthday requeues the blocks above the new birthday so that they are scanned with the new account’s keys. The witness data that the wallet holds for an existing note in a completed shard is unaffected, so the note is spendable again as soon as the chain-tip pruning window is rescanned.
- completed_
shard_ note_ spendable_ after_ rewind_ once_ window_ rescanned - A rewind below an account’s birthday requeues every block above the rewind target for scanning, but it truncates only the chain-tip pruning window. The witness data that the wallet holds below the window for a note in a completed shard is unaffected, so the note is spendable again as soon as the pruning window is rescanned, while its own shard’s blocks are still queued.
- completed_
shard_ note_ spendable_ after_ scanning_ anchor_ window - A chain tip advance that leaves the wallet more than the pruning window behind schedules the
window ahead of the rest of the unscanned range. Scanning only the ranges scheduled above
ScanPriority::ChainTipmakes a note in a completed shard spendable again, while blocks between the previously scanned tip and the window remain unscanned. - completed_
shard_ note_ spendable_ with_ unscanned_ gap_ below_ it - A note’s in-shard witness needs every leaf to its right through the shard’s end, and none to its left beyond what the frontier inserted when its block was scanned already supplies. A note found in the block that completes its shard is therefore spendable while the earlier block of that shard remains unscanned.
- create_
pczt_ supports_ ironwood_ output orchardandpczt - PCZT construction supports the version 6 transaction format, including its Ironwood bundle.
After NU6.3 a payment to an Orchard receiver is delivered through the Ironwood pool, so
create_pczt_from_proposalrealizes such a proposal as a version 6 PCZT that carries a populated Ironwood bundle. - create_
pczt_ uses_ nu7_ default_ expiry pczt - Tests that a PCZT that the wallet creates with no explicit expiry height expires after the default expiry delta for its target height: 40 blocks before NU7 activation, and 120 blocks from NU7 activation onward.
- create_
proposed_ transactions_ uses_ nu7_ default_ expiry - Tests that a transaction that the wallet creates with no explicit expiry height expires after the default expiry delta for its target height: 40 blocks before NU7 activation, and 120 blocks from NU7 activation onward.
- create_
to_ address_ fails_ on_ incorrect_ usk - create_
to_ address_ respects_ recipient_ expiry - Tests that payment construction enforces the ZIP 316 Revision 2 address expiration rules: a payment to an address whose expiry height conflicts with the transaction’s expiry height is refused, a payment to an address whose expiry time has passed is refused (for any recipient of a multi-recipient transaction), and a payment to an address with unexpired metadata succeeds.
- data_
db_ truncation - dust_
threshold_ follows_ marginal_ fee_ at_ target_ height - The wallet classifies a note as uneconomic by the ZIP 317 marginal fee in effect at the target height: a note worth the marginal fee before the fee reduction height of ZIP 2009 is reported as uneconomic and left out of selection and proposals while the target height is below that height, and is spendable and selected from it.
- empty_
boundary_ blocks_ are_ checkpointed_ and_ retained orchard - A grid boundary that lands on a block containing no note commitments in ANY pool must still be checkpointed and retained. Scanning checkpoints a block only at its last note commitment, so such a block produces no checkpoint of its own in any tree and the cross-pool ensure step has nothing to copy; unless the retained heights are ensured explicitly, the retained grid gains a permanent hole there — on mainnet a sizeable fraction of blocks carry no shielded outputs — and a ZIP 318 crossing anchored to the hole can never be proved.
- external_
address_ change_ spends_ detected_ in_ restore_ from_ seed - fails_
to_ send_ max_ spendable_ to_ transparent_ with_ memo transparent-inputs - Tests that sending all the spendable funds within the given shielded pool in a single transaction to a transparent address with a memo fails.
- fully_
funded_ fully_ private orchard - fully_
funded_ send_ to_ t orchardandtransparent-inputs - immature_
coinbase_ outputs_ are_ excluded_ from_ note_ selection pcztandtransparent-inputs - Tests that immature coinbase outputs are excluded from note selection.
- insufficient_
funds_ counts_ transparent_ inputs transparent-inputs - Tests that the
InsufficientFundserror of a transfer permitted to spend the account’s transparent outputs reports the value of those outputs as available, alongside the notes. - invalid_
chain_ cache_ disconnected - metadata_
queries_ exclude_ unwanted_ notes - multi_
note_ crossing_ is_ not_ bucketed orchard - A canonical amount that cannot be funded from a single Orchard note is NOT a canonical crossing, and must not pay for a bucketed anchor it gains nothing from.
- multi_
pool_ checkpoint orchard - multi_
pool_ checkpoints_ with_ pruning orchard - note_
in_ recently_ completed_ shard_ spendable_ once_ confirmed - A note that the wallet discovers in a shard completed within the last
min_confirmationsblocks has a settled height at the shard’s end, above the anchor height. The note is spendable, and a transaction spending it can be built, as soon as it has the required confirmations. - oldest_
note_ is_ selected_ first - Note selection draws the OLDEST eligible notes first, where age is chain order — the note’s commitment tree position — not discovery order. Priority scanning discovers recent blocks before back-filling history, so a restored wallet’s newest notes carry its lowest row ids; ordering by id would spend fresh change while far older notes sat idle. The ordering must therefore survive scanning blocks out of order.
- open_
shard_ note_ spendable_ across_ commitment_ free_ stretch Checkpointretention covers every height withinPRUNING_DEPTHof the chain tip, so a commitment-free stretch of blocks never leaves the wallet without an anchor at the policy depth. A note in the open tip shard, whose settled height advances with the pruning floor, therefore stays spendable across such a stretch.- open_
shard_ note_ spendable_ across_ older_ birthday_ import - As
completed_shard_note_spendable_across_older_birthday_importdescribes, an import below the wallet birthday requeues the blocks above the new birthday. A note in the open chain-tip shard, buried deeper than the pruning window, has its witness data settled through the pruning floor, so it too is spendable again as soon as the pruning window is rescanned. - orchard_
to_ ironwood_ payment_ reports_ net_ value_ delta orchard - The transaction history entry for a payment funded from the Orchard pool and delivered through the Ironwood pool reports the amount that left the account (payment plus fee) as its balance delta, not the total value of the notes spent, which would ignore the change returned to the wallet.
- orchard_
to_ ironwood_ self_ migration_ reports_ fee_ only_ delta orchard - A migration of the wallet’s own funds from the Orchard pool to the Ironwood pool, namely a payment to the wallet’s own external Orchard receiver delivered through the Ironwood pool, leaves the account balance unchanged except for the fee. The payment output returned to the wallet is not recorded at transaction-creation time (it is an address payment, which the wallet expects to detect by scanning), so this exercises detection of the wallet’s own Ironwood outputs in the scanning path.
- ovk_
policy_ prevents_ recovery_ from_ chain - pczt_
single_ step pczt - pool_
crossing_ required orchard - proposal_
fails_ if_ not_ all_ ephemeral_ outputs_ consumed transparent-inputs - proposal_
fails_ with_ no_ blocks - proposal_
fee_ is_ fixed_ at_ its_ target_ height_ across_ fee_ reduction - A proposal’s fee is the ZIP 317 fee in effect at its target height, and the transaction built from it pays that fee even when the chain crosses the fee reduction height of ZIP 2009 between proposal and build; a proposal made from that height onward pays the reduced fee.
- proposal_
records_ and_ serializes_ proposed_ version orchard - The transaction version requested at proposal time is recorded on the proposal and preserved across serialization, so that transaction building honors it. A proposal serialized without a version request (as older serializers produced) decodes with no requested version and falls back to the target-height version at build time.
- proposal_
without_ confirmations_ policy_ builds pcztandtransparent-inputs - A newly constructed shielding proposal preserves the checkpoint selected by the wallet, even though it spends no shielded notes. A proposal serialized without the confirmations-policy field (as an older library version would have produced) decodes using the default policy and, because it still carries that real anchor, builds. Separately, a shielding step produces a shielded bundle, so a proposal that encodes such a step with the zero anchor sentinel is rejected at the parse boundary.
- propose_
and_ build_ shielding_ coinbase_ succeeds pcztandtransparent-inputs - Regression test for the propose-fee/build-fee mismatch fixed in #2376.
- propose_
shielding_ coinbase_ succeeds pcztandtransparent-inputs - Verifies that
propose_shielding_coinbasewith a shielded destination produces a proposal containing a single ZIP-321 payment to the supplied address for the full available value (input total minus fee), with no change. - propose_
shielding_ coinbase_ transparent_ recipient_ rejected pcztandtransparent-inputs - Verifies that
propose_shielding_coinbaserejects a transparent destination withProposalError::ShieldingRequiresShieldedRecipient. - propose_
shielding_ coinbase_ with_ limit_ truncates_ inputs pcztandtransparent-inputs - Verifies that
propose_shielding_coinbasewithlimit = Some(n)selects at mostnUTXOs, preferring the highest-value coinbase outputs. - propose_
shielding_ coinbase_ with_ memo_ succeeds pcztandtransparent-inputs - Verifies that
propose_shielding_coinbasepropagates the suppliedmemointo the resulting payment’s memo field. - propose_
shielding_ coinbase_ with_ zero_ limit_ insufficient_ funds pcztandtransparent-inputs - Verifies that
propose_shielding_coinbasewithlimit = Some(0)selects no inputs, returningInputSelectorError::InsufficientFunds. - propose_
v5_ payment_ to_ orchard_ receiver_ is_ rejected orchard - After NU6.3 activation, a payment to an Orchard receiver must be delivered through the
Ironwood pool, which requires a version 6 transaction. Explicitly requesting a version 5
transaction — which has no Ironwood bundle — for such a payment must be rejected at proposal
time with
ProposalError::OrchardReceiverRequiresIronwood, rather than producing a proposal that could only fail later at build time. - receive_
two_ notes_ with_ same_ value - Tests that the wallet correctly reports balance with two notes that are identical other than their note randomness.
- reorg_
below_ scanned_ height_ is_ a_ continuity_ error - A block downloaded for a height the wallet has already scanned, carrying a different hash, is a chain reorg. Scanning must report it as a continuity error before any wallet state is written, so that the sync loop rewinds, rather than surface it from the storage layer as a conflict the loop cannot classify.
- reorg_
to_ checkpoint - retained_
boundaries_ below_ window_ are_ usable_ anchors orchard - Anchor-retention boundaries that lie below the checkpoint window, on blocks that carry no note commitment, are checkpointed and retained in every tree, and each such checkpoint is a usable anchor: its root is computable, and the received note has a witness there. This holds whether the wallet scans the boundaries before or after the checkpoint window at the tip.
- rewind_
after_ non_ contiguous_ scan - rewind_
to_ chain_ state_ deep - rewind_
to_ chain_ state_ shallow - scan_
cached_ blocks_ allows_ blocks_ out_ of_ order - scan_
cached_ blocks_ detects_ spends_ out_ of_ order - scan_
cached_ blocks_ finds_ change_ notes - scan_
cached_ blocks_ finds_ received_ notes - scan_
full_ block_ detects_ outputs - Builds a real transaction via the proposal/creation path, assembles it into a full
block, and verifies that
decrypt_blockfollowed byscan_blockdetects the wallet output (the change note) that it contains. - self_
migration_ keeps_ spending_ orchard orchard - Self-migration does not stall once the wallet holds Ironwood notes.
- send_
max_ fails_ when_ balance_ is_ consumed_ by_ fees - Tests that a send-max proposal fails with
InsufficientFundswhen the entire wallet balance would be consumed by fees, rather than proposing a transaction that delivers nothing to the recipient. - send_
max_ fee_ overflow_ is_ an_ error transparent-inputs - Tests that a send-max proposal whose total required fee overflows the maximum monetary amount fails with a balance error rather than panicking.
- send_
max_ spendable_ proposal_ succeeds_ when_ unconfirmed_ funds_ present - Tests that attempting to send
MaxSpendablefunds within the given shielded pool in a single transaction succeeds if there are funds that are not yet confirmed. - send_
max_ spendable_ to_ transparent transparent-inputs - Tests that sending all the spendable funds within the given shielded pool to a transparent (non-TEX) recipient succeeds.
- send_
max_ spends_ inputs_ across_ pools orchard - Tests that a send-max proposal spends notes from multiple shielded pools in a single transaction when the wallet’s funds are split across pools.
- send_
multi_ step_ proposed_ transfer transparent-inputs - send_
single_ step_ proposed_ transfer - Tests sending funds within the given shielded pool in a single transaction.
- send_
with_ multiple_ change_ outputs - shard_
completeness_ derives_ from_ scan_ queue - Shard completeness is a property of the scan queue, not of the subtree-root table. A note stabilized in the open tip shard, whose shard the server later reports complete while the blocks between the wallet’s scanned tip and the shard’s end remain unscanned, must not be reported spendable: the wallet holds no leaves for that region, so no witness against any later anchor can be built. Scanning the region restores spendability.
- shield_
transparent transparent-inputs - shielding_
coinbase_ to_ orchard_ receiver_ delivers_ via_ ironwood orchardandpcztandtransparent-inputs - Verifies that once Ironwood is active,
propose_shielding_coinbaseresolves a destination with an Orchard receiver to the Ironwood pool — the payment is delivered to the Orchard receiver via the Ironwood bundle — and that the proposed transaction builds. - spend_
all_ funds_ multi_ step_ proposed_ transfer transparent-inputs - Test attempts to sweep a wallet into a TEX address
- spend_
all_ funds_ single_ step_ proposed_ transfer - Tests spending all funds within the given shielded pool in a single transaction.
- spend_
everything_ multi_ step_ many_ notes_ proposed_ transfer transparent-inputs - This test attempts to send the max spendable funds to a TEX address recipient checks that the transactions were stored and that the amounts involved are correct
- spend_
everything_ multi_ step_ single_ note_ proposed_ transfer transparent-inputs - This test attempts to send the max spendable funds to a TEX address recipient checks that the transactions were stored and that the amounts involved are correct
- spend_
everything_ multi_ step_ with_ marginal_ notes_ proposed_ transfer transparent-inputs - This test attempts to send the max spendable funds to a TEX address recipient. The wallet contains many notes denominated with the marginal fee value. Checks that the transactions were stored and that the amounts involved are correct
- spend_
everything_ proposal_ fails_ when_ unconfirmed_ funds_ present - Tests that attempting to send all the spendable funds within the given shielded pool in a single transaction fail if there are funds that are not yet confirmed.
- spend_
everything_ single_ step_ proposed_ transfer - Tests sending every piece of spendable funds within the given shielded pool in a single transaction.
- spend_
fails_ on_ unverified_ notes - spend_
max_ spendable_ single_ step_ proposed_ transfer - Tests max spendable funds within the given shielded pool in a single transaction.
- spend_
succeeds_ to_ t_ addr_ zero_ change - spendable_
balance_ agrees_ with_ note_ selection - The spendable balance that the wallet summary reports equals the value of the notes that note selection returns for the same confirmations policy, through both selection paths, in each of several wallet states: confirmed notes, an unconfirmed note, a chain tip advance shorter than the anchor depth, a chain tip advance far beyond the pruning window, and after the wallet scans to the new tip.
- stabilized_
note_ rewind_ above_ shard_ end - R2: rewind to a height above shard 1’s end (stable-shard fixture).
- stabilized_
note_ rewind_ un_ mines_ shard_ completion - R3: rewind un-mines the shard-completion block (tip-shard fixture).
- stabilized_
note_ settled_ height_ invalidated_ by_ reorg - A note’s settled height (
witness_settled_height) is a claim about the chain the wallet was observing when the height was written: every block bearing on the note’s witness context up to that height has been scanned, so the wallet’s determination of witness constructability is grounded in chain data it has verified. A rewind that truncates wallet state below a settled height discards the scanned blocks and tree data backing that claim, so the claim must not survive the truncation. - stabilized_
note_ spendable_ across_ small_ tip_ advance - A stabilized note must remain spendable across a chain-tip advance smaller than the trusted anchor depth, and must stop being spendable once the advance reaches that depth.
- transfer_
fails_ across_ pools_ at_ a_ dust_ shortfall orchard - Tests that a transfer which draws on a second pool at a dust shortfall reports
InsufficientFundsover both pools when the second note cannot cover the two-bundle fee. - transfer_
grows_ across_ pools_ at_ a_ dust_ shortfall orchard - Tests that a transfer whose change from the preferred pool’s note would be dust draws on a note in another pool instead of failing.
- truncate_
to_ chain_ state - truncate_
to_ chain_ state_ above_ scanned - truncate_
to_ chain_ state_ below_ birthday - valid_
chain_ states - wallet_
recovery_ computes_ fees transparent-inputs - Ensure that wallet recovery recomputes fees.
- zip317_
spend - zip_
315_ confirmations_ test_ steps - Tests that inputs from a source can be spent according to the default
ConfirmationsPolicy.