MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / TestBnBFail

Function TestBnBFail

src/wallet/test/coinselection_tests.cpp:133–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133static void TestBnBFail(std::string test_title, std::vector<OutputGroup>& utxo_pool, const CAmount& selection_target, const CoinSelectionParams& cs_params = default_cs_params, int max_selection_weight = MAX_STANDARD_TX_WEIGHT, const bool expect_max_weight_exceeded = false)
134{
135 const auto result = SelectCoinsBnB(utxo_pool, selection_target, /*cost_of_change=*/cs_params.m_cost_of_change, max_selection_weight);
136 BOOST_CHECK_MESSAGE(!result, "BnB-Fail: " + test_title);
137 bool max_weight_exceeded = util::ErrorString(result).original.find("The inputs size exceeds the maximum weight") != std::string::npos;
138 BOOST_CHECK(expect_max_weight_exceeded == max_weight_exceeded);
139}
140
141BOOST_AUTO_TEST_CASE(bnb_test)
142{

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

ErrorStringFunction · 0.85
findMethod · 0.80
SelectCoinsBnBFunction · 0.70

Tested by

no test coverage detected