Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
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/common.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 172 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 114 of file txdownload_tests.cpp.

Here is the call graph for this function:

◆ CheckOrphanBehavior()

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 75 of file txdownload_tests.cpp.

Here is the caller graph for this function:

◆ CreatePlaceholderTx()

CTransactionRef CreatePlaceholderTx ( bool segwit)
static

Definition at line 99 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
Definition validation.h:28
@ TX_MEMPOOL_POLICY
violated mempool's fee/size/descendant/RBF/etc limits
Definition validation.h:46
@ TX_UNKNOWN
transaction was not validated because package failed
Definition validation.h:49
@ TX_PREMATURE_SPEND
transaction spends a coinbase too early, or violates locktime/sequence locks
Definition validation.h:29
@ TX_INPUTS_NOT_STANDARD
inputs (covered by txid) failed policy rules
Definition validation.h:26
@ TX_WITNESS_STRIPPED
Transaction is missing a witness.
Definition validation.h:39
@ TX_CONFLICT
Tx already in mempool or conflicts with a tx in the chain (if it conflicts with another tx in mempool...
Definition validation.h:45
@ TX_NOT_STANDARD
otherwise didn't meet our local policy rules
Definition validation.h:27
@ TX_WITNESS_MUTATED
Transaction might have a witness prior to SegWit activation, or witness may have been malleated (whic...
Definition validation.h:35
@ TX_NO_MEMPOOL
this node does not have a mempool so can't validate the transaction
Definition validation.h:47
@ TX_CONSENSUS
invalid by consensus rules
Definition validation.h:25
@ TX_RECONSIDERABLE
fails some policy, but might be acceptable if submitted in a (different) package
Definition validation.h:48

Definition at line 60 of file txdownload_tests.cpp.