| 131 | } |
| 132 | |
| 133 | static 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 | |
| 141 | BOOST_AUTO_TEST_CASE(bnb_test) |
| 142 | { |
no test coverage detected