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§
- 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. - 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_ 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 - 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. - 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 - 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 - newly_
discovered_ notes_ become_ stabilized - Verifies that when a new account is imported into a fully-scanned wallet,
the ensuing re-scan discovers the new account’s previously-unknown notes
and
scan_complete → mark_stabilized_notesflags themwitness_stabilizedon the fly, so they remain spendable across a subsequent deeprewind_to_chain_state. - 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.
- 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_
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_
to_ checkpoint - 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 - 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 - stabilized_
note_ spendable_ after_ deep_ rewind - Multiple wallet notes in a stabilized shard remain spendable after a deep
rewind_to_chain_statemoves the scan queue below them. - 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.