Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Functions | Variables
txdownload_tests.cpp File Reference
#include <addresstype.h>
#include <consensus/validation.h>
#include <net_processing.h>
#include <node/txdownloadman_impl.h>
#include <primitives/transaction.h>
#include <script/script.h>
#include <test/util/random.h>
#include <test/util/setup_common.h>
#include <validation.h>
#include <array>
#include <boost/test/unit_test.hpp>
Include dependency graph for txdownload_tests.cpp:

Go to the source code of this file.

Classes

struct  Behaviors
 

Functions

static bool CheckOrphanBehavior (node::TxDownloadManagerImpl &txdownload_impl, const CTransactionRef &tx, const node::RejectedTxTodo &ret, std::string &err_msg, bool expect_orphan, bool expect_keep, unsigned int expected_parents)
 
static CTransactionRef CreatePlaceholderTx (bool segwit)
 
 BOOST_FIXTURE_TEST_CASE (tx_rejection_types, TestChain100Setup)
 
 BOOST_FIXTURE_TEST_CASE (handle_missing_inputs, TestChain100Setup)
 

Variables

static std::map< TxValidationResult, Behaviorsexpected_behaviors
 

Function Documentation

◆ BOOST_FIXTURE_TEST_CASE() [1/2]

BOOST_FIXTURE_TEST_CASE ( handle_missing_inputs  ,
TestChain100Setup   
)

Definition at line 171 of file txdownload_tests.cpp.

Here is the call graph for this function:

◆ BOOST_FIXTURE_TEST_CASE() [2/2]

BOOST_FIXTURE_TEST_CASE ( tx_rejection_types  ,
TestChain100Setup   
)

Definition at line 113 of file txdownload_tests.cpp.

Here is the call graph for this function:

◆ CheckOrphanBehavior()

static bool CheckOrphanBehavior ( node::TxDownloadManagerImpl txdownload_impl,
const CTransactionRef tx,
const node::RejectedTxTodo ret,
std::string &  err_msg,
bool  expect_orphan,
bool  expect_keep,
unsigned int  expected_parents 
)
static

Definition at line 74 of file txdownload_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreatePlaceholderTx()

static CTransactionRef CreatePlaceholderTx ( bool  segwit)
static

Definition at line 98 of file txdownload_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ expected_behaviors

std::map<TxValidationResult, Behaviors> expected_behaviors
static
Initial value:
{
{TxValidationResult::TX_INPUTS_NOT_STANDARD, { 1, 1, 0, 0, 1, 1, 1}},
{TxValidationResult::TX_NOT_STANDARD, { 0, 1, 0, 0, 1, 0, 1}},
{TxValidationResult::TX_MISSING_INPUTS, { 0, 0, 0, 0, 1, 0, 1}},
{TxValidationResult::TX_PREMATURE_SPEND, { 0, 1, 0, 0, 1, 0, 1}},
{TxValidationResult::TX_WITNESS_MUTATED, { 0, 1, 0, 0, 1, 0, 1}},
{TxValidationResult::TX_WITNESS_STRIPPED, { 0, 0, 0, 0, 0, 0, 0}},
{TxValidationResult::TX_CONFLICT, { 0, 1, 0, 0, 1, 0, 1}},
{TxValidationResult::TX_MEMPOOL_POLICY, { 0, 1, 0, 0, 1, 0, 1}},
{TxValidationResult::TX_NO_MEMPOOL, { 0, 1, 0, 0, 1, 0, 1}},
{TxValidationResult::TX_RECONSIDERABLE, { 0, 0, 0, 1, 1, 0, 1}},
{TxValidationResult::TX_UNKNOWN, { 0, 1, 0, 0, 1, 0, 1}},
}
@ TX_MISSING_INPUTS
transaction was missing some of its inputs
@ TX_MEMPOOL_POLICY
violated mempool's fee/size/descendant/RBF/etc limits
@ TX_UNKNOWN
transaction was not validated because package failed
@ TX_PREMATURE_SPEND
transaction spends a coinbase too early, or violates locktime/sequence locks
@ TX_INPUTS_NOT_STANDARD
inputs (covered by txid) failed policy rules
@ TX_WITNESS_STRIPPED
Transaction is missing a witness.
@ TX_CONFLICT
Tx already in mempool or conflicts with a tx in the chain (if it conflicts with another tx in mempool...
@ TX_NOT_STANDARD
otherwise didn't meet our local policy rules
@ TX_WITNESS_MUTATED
Transaction might have a witness prior to SegWit activation, or witness may have been malleated (whic...
@ TX_NO_MEMPOOL
this node does not have a mempool so can't validate the transaction
@ TX_CONSENSUS
invalid by consensus rules
@ TX_RECONSIDERABLE
fails some policy, but might be acceptable if submitted in a (different) package

Definition at line 59 of file txdownload_tests.cpp.