Bitcoin Core  24.99.0
P2P Digital Currency
Namespaces | Macros | Typedefs | Functions | Variables
coinselector_tests.cpp File Reference
#include <consensus/amount.h>
#include <node/context.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <random.h>
#include <test/util/setup_common.h>
#include <util/translation.h>
#include <wallet/coincontrol.h>
#include <wallet/coinselection.h>
#include <wallet/spend.h>
#include <wallet/test/wallet_test_fixture.h>
#include <wallet/wallet.h>
#include <algorithm>
#include <boost/test/unit_test.hpp>
#include <random>
Include dependency graph for coinselector_tests.cpp:

Go to the source code of this file.




#define RUN_TESTS   100
#define RANDOM_REPEATS   5


typedef std::set< std::shared_ptr< COutput > > wallet::CoinSet


static void wallet::add_coin (const CAmount &nValue, int nInput, std::vector< COutput > &set)
static void wallet::add_coin (const CAmount &nValue, int nInput, SelectionResult &result)
static void wallet::add_coin (const CAmount &nValue, int nInput, CoinSet &set, CAmount fee=0, CAmount long_term_fee=0)
static void wallet::add_coin (CoinsResult &available_coins, CWallet &wallet, const CAmount &nValue, CFeeRate feerate=CFeeRate(0), int nAge=6 *24, bool fIsFromMe=false, int nInput=0, bool spendable=false)
static bool wallet::EquivalentResult (const SelectionResult &a, const SelectionResult &b)
 Check if SelectionResult a is equivalent to SelectionResult b. More...
static bool wallet::EqualResult (const SelectionResult &a, const SelectionResult &b)
 Check if this selection is equal to another one. More...
static CAmount wallet::make_hard_case (int utxos, std::vector< COutput > &utxo_pool)
std::vector< OutputGroup > & wallet::GroupCoins (const std::vector< COutput > &available_coins)
std::vector< OutputGroup > & wallet::KnapsackGroupOutputs (const CoinsResult &available_coins, CWallet &wallet, const CoinEligibilityFilter &filter)
 wallet::BOOST_AUTO_TEST_CASE (bnb_search_test)
 wallet::BOOST_AUTO_TEST_CASE (knapsack_solver_test)
 wallet::BOOST_AUTO_TEST_CASE (ApproximateBestSubset)
 wallet::BOOST_AUTO_TEST_CASE (SelectCoins_test)
 wallet::BOOST_AUTO_TEST_CASE (waste_test)
 wallet::BOOST_AUTO_TEST_CASE (effective_value_test)
static util::Result< SelectionResult > wallet::select_coins (const CAmount &target, const CoinSelectionParams &cs_params, const CCoinControl &cc, std::function< CoinsResult(CWallet &)> coin_setup, interfaces::Chain *chain)
static bool wallet::has_coin (const CoinSet &set, CAmount amount)
 wallet::BOOST_AUTO_TEST_CASE (check_max_weight)
 wallet::BOOST_AUTO_TEST_CASE (SelectCoins_effective_value_test)
 wallet::BOOST_FIXTURE_TEST_CASE (wallet_coinsresult_test, BasicTestingSetup)


static const CoinEligibilityFilter wallet::filter_standard (1, 6, 0)
static const CoinEligibilityFilter wallet::filter_confirmed (1, 1, 0)
static const CoinEligibilityFilter wallet::filter_standard_extra (6, 6, 0)
static int wallet::nextLockTime = 0

Macro Definition Documentation


#define RANDOM_REPEATS   5

Definition at line 30 of file coinselector_tests.cpp.


#define RUN_TESTS   100

Definition at line 26 of file coinselector_tests.cpp.