Skip to main content

Module test_utils

Module test_utils 

Source
Expand description

Property test strategies and shared test fixtures.

Enables integration tests to use strategies that satisfy Orange Paper constraints (e.g. |w| = |tx.inputs| for SegWit round-trip) and shared UTXO-set helpers.

Functions§

create_coinbase_tx
Create a valid coinbase transaction (scriptSig 2–100 bytes per consensus). Shared by integration tests so fixture behavior stays consistent.
create_test_header
Create a block header with the given timestamp and previous block hash. Shared by integration tests so fixture behavior stays consistent.
create_test_utxo_set_two_outputs
UTXO set with two outputs for fee-calculation style tests (1 BTC and 0.5 BTC). Shared by integration tests so fixture behavior stays consistent.
transaction_strategy
Strategy yielding Transaction for legacy (non-SegWit) round-trip tests.
transaction_with_witness_strategy
Strategy yielding (Transaction, Vec) with |w| = |tx.inputs|. Use for SegWit round-trip property tests per Orange Paper 8.2.2.