Bitcoin Core 29.99.0
P2P Digital Currency
Namespaces | Functions | Variables
coinselection_tests.cpp File Reference
#include <consensus/amount.h>
#include <policy/policy.h>
#include <wallet/coinselection.h>
#include <wallet/test/wallet_test_fixture.h>
#include <boost/test/unit_test.hpp>
Include dependency graph for coinselection_tests.cpp:

Go to the source code of this file.

Namespaces

namespace  wallet
 

Functions

static CoinSelectionParams wallet::init_default_params ()
 Default coin selection parameters (dcsp) allow us to only explicitly set parameters when a diverging value is relevant in the context of a test. More...
 
static OutputGroup wallet::MakeCoin (const CAmount &amount, bool is_eff_value=true, CoinSelectionParams cs_params=default_cs_params, int custom_spending_vsize=68)
 Make one OutputGroup with a single UTXO that either has a given effective value (default) or a given amount (is_eff_value = false). More...
 
static void wallet::AddCoins (std::vector< OutputGroup > &utxo_pool, std::vector< CAmount > coins, CoinSelectionParams cs_params=default_cs_params)
 Make multiple OutputGroups with the given values as their effective value. More...
 
static void wallet::AddDuplicateCoins (std::vector< OutputGroup > &utxo_pool, int count, int amount, CoinSelectionParams cs_params=default_cs_params)
 Make multiple coins that share the same effective value. More...
 
static bool wallet::HaveEquivalentValues (const SelectionResult &a, const SelectionResult &b)
 Check if SelectionResult a is equivalent to SelectionResult b. More...
 
static std::string wallet::InputAmountsToString (const SelectionResult &selection)
 
static void wallet::TestBnBSuccess (std::string test_title, std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, const std::vector< CAmount > &expected_input_amounts, const CoinSelectionParams &cs_params=default_cs_params, int custom_spending_vsize=68)
 
static void wallet::TestBnBFail (std::string test_title, std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target)
 
 wallet::BOOST_AUTO_TEST_CASE (bnb_test)
 
 wallet::BOOST_AUTO_TEST_CASE (bnb_feerate_sensitivity_test)
 

Variables

static int wallet::next_lock_time = 0
 
static FastRandomContext wallet::default_rand
 
static const CoinSelectionParams wallet::default_cs_params = init_default_params()