Skip to main content

Module transparent

Module transparent 

Source
Available on crate feature transparent-inputs and (crate features test-dependencies) only.

Re-exports§

pub use super::pool::locking::transparent_note_locking;

Functions§

gap_limits
get_spendable_transparent_outputs_for_addresses
Verifies that InputSource::get_spendable_transparent_outputs_for_addresses returns the spendable outputs for a set of addresses in a single call, equivalent to the union of per-address queries, and honours subset and empty requests.
import_standalone_transparent_addresstransparent-key-import
Tests that importing standalone transparent addresses without key material succeeds and the addresses appear in get_transparent_receivers with the TransparentAddressSource::StandaloneAddress source.
import_standalone_transparent_address_balancetransparent-key-import
Tests that a UTXO received at an address imported without key material is reflected in the wallet balance, but is not offered as a spendable output.
import_standalone_transparent_address_conflicttransparent-key-import
Tests that importing the same standalone address to a different account fails.
import_standalone_transparent_address_idempotenttransparent-key-import
Tests that importing the same standalone address twice to the same account is idempotent.
import_standalone_transparent_address_upgradetransparent-key-import
Tests that importing key material for a previously address-only import upgrades the address in place: the pubkey (P2PKH) or redeem script (P2SH) becomes the address’s source, without a duplicate receiver appearing.
import_standalone_transparent_p2shtransparent-key-import
Tests that importing a standalone P2SH address succeeds and the address appears in get_transparent_receivers with the correct TransparentAddressSource.
import_standalone_transparent_p2sh_balancetransparent-key-import
Tests that a UTXO received at a standalone P2SH address is reflected in the wallet balance.
import_standalone_transparent_p2sh_conflicttransparent-key-import
Tests that importing the same P2SH address to a different account fails.
import_standalone_transparent_p2sh_idempotenttransparent-key-import
Tests that importing the same P2SH address twice to the same account is idempotent.
import_standalone_transparent_pubkeytransparent-key-import
Tests that importing a standalone transparent public key succeeds.
import_standalone_transparent_pubkey_balancetransparent-key-import
Tests that a UTXO received at a standalone P2PKH address is reflected in the wallet balance.
import_standalone_transparent_pubkey_conflicttransparent-key-import
Tests that importing the same pubkey to a different account fails.
import_standalone_transparent_pubkey_idempotenttransparent-key-import
Tests that importing the same pubkey twice to the same account is idempotent.
mark_transparent_addresses_exposed
Tests WalletWrite::mark_transparent_addresses_exposed by observing the effect on the address’s exposure metadata via WalletRead::get_transparent_address_metadata.
mark_transparent_addresses_exposed_bulk
Tests that WalletWrite::mark_transparent_addresses_exposed correctly handles bulk input: all addresses in a successful call must be marked, and an unrecognized address must cause the entire call to be rolled back.
mark_transparent_addresses_exposed_unknown_address
Tests that WalletWrite::mark_transparent_addresses_exposed returns an error when asked to mark an address that the wallet does not track.
propose_t2shielded_requires_transparent_regather
Verifies that GreedyInputSelector::propose_transaction successfully re-gathers transparent inputs when the initial fee-aware gather’s estimate (which accounts only for the transparent side of the transaction) turns out to be insufficient once the real change strategy accounts for the additional shielded action required by a shielded payment recipient.
propose_t2t_any_account_taddr
With TransparentSpendPolicy::any_account_addr (the legacy ANY_TADDR behavior), a transfer may spend the account’s transparent UTXOs. Verifies that the funding UTXO is selected as a transparent input and that the proposal balance is consistent.
propose_t2t_from_addresses
With a TransparentSource::FromAddresses transparent source, only the explicitly named transparent addresses are eligible. Funds two of the account’s external receivers but names only one; the proposal must select solely from the named address.
propose_t2t_shielded_only_is_insufficient
Regression test enforcing the privacy invariant: with the default default spend policy (which permits no transparent spending), a transfer must NOT silently spend the account’s transparent UTXOs as a fallback. An account holding only transparent funds must fail with InsufficientFunds rather than producing a t->t proposal.
propose_t2t_transparent_change_exact_match
Tests that when a fully-transparent transaction balances exactly (input value equals payments plus the minimum fee), no transparent change output is produced even when the change strategy is configured with TransparentChangePolicy::TransparentChangeAllowed.
propose_t2t_with_transparent_change
Tests the full lifecycle of a t->t transfer with transparent change: a change strategy configured with TransparentChangePolicy::TransparentChangeAllowed must propose a non-ephemeral transparent change output, and transaction creation must send that change to a previously-unexposed internal-scope (change) transparent address of the spending account, where it is recorded as received and becomes spendable once mined.
propose_transfer_transparent_input_cap
Verifies that GreedyInputSelector::with_shielding_block_space_percent also bounds the transparent gather performed for general (non-shielding) transfers, not just shielding.
put_blocks_rolls_back_transparent_outputs
Verifies that the transparent outputs written while persisting a batch of scanned blocks are rolled back along with the rest of the batch when a later block in the batch is rejected.
put_received_transparent_utxo
put_received_unmined_utxo_uses_mempool_height_expiry_delta
Tests that an unmined UTXO received when the chain tip is one block below NU7 activation is assumed to expire after the default expiry delta for the mempool height, which is the NU7 activation height.
reserve_next_n_internal_addresses_gap_limit
Tests that WalletWrite::reserve_next_n_internal_addresses reserves sequential internal-scope (change) addresses, that reservation observes the internal-scope gap limit, and that internal-scope reservations are accounted independently of ephemeral-scope reservations.
scan_detects_out_of_order_transparent_spend
Scans a block that spends a wallet transparent output before scanning the block that created it, and verifies that the spend is recognized once the output is discovered.
scan_detects_transparent_spend
Scans a block that pays a wallet transparent address, then the block that spends the output, and verifies that the spend is recognized directly during the scan of the later block.
scan_full_block_detects_out_of_order_transparent_spend
Scans a full block that spends a wallet transparent output before the block that created it, and verifies that the spend is resolved once the output is discovered.
scan_full_block_detects_transparent_spend
Scans a full block that pays a wallet transparent address, then a full block that spends the resulting output, and verifies that the spend is detected.
scan_full_block_persists_transparent_outputs
Scans a full block containing a transparent output that pays a wallet address, and verifies that persisting the scanned block via WalletWrite::put_blocks records that output as a UTXO belonging to the wallet.
shielding_many_transparent_utxos
Regression test for PRO-291: shielding a transparent balance composed of many P2PKH UTXOs must not fail with ChangeRequired due to fee disagreement between the proposal and builder layers.
shielding_transparent_input_cap
Verifies that a shielding proposal caps the number of transparent inputs in a single transaction to the selector’s configured fraction of block space, selecting the highest-value UTXOs first and leaving the remainder unspent.
spend_from_standalone_p2shtransparent-key-import
Tests spending from a standalone P2SH (multisig) address by shielding its balance.
spend_from_standalone_pubkeytransparent-key-import
Tests spending from a standalone P2PKH address by shielding its balance.
transparent_balance_across_shielding
transparent_balance_spendability
This test attempts to verify that transparent funds spendability is accounted for properly given the different minimum confirmations values that can be set when querying for balances.
transparent_coinbase_balance_dust
Verifies that dust-valued (uneconomic) transparent outputs are reported in the uneconomic_value field of the correct AccountBalance bucket (regular vs. coinbase).
transparent_coinbase_balance_split
Verifies that transparent funds are reported in the correct AccountBalance bucket (regular vs. coinbase), that immature coinbase value is reported as pending rather than spendable, and that it becomes spendable upon reaching coinbase maturity.
value_bounded_transparent_gather
Verifies that the value-bounded select_spendable_transparent_outputs gather returns only enough UTXOs to cover the requested TargetValue, rather than every spendable output held by the account. This is the behavior that prevents wallets with large numbers of small transparent UTXOs (e.g. recovered zcashd imports) from falling over when a small transfer is requested.