tests: Add KnapsackGroupOutputs helper function

In order to change the KnapsackSolver tests to call KnapsackSolver, we
need KnapsackGroupOutputs to create the OutputGroups filtered with the
filter criteria.
This commit is contained in:
Andrew Chow 2021-07-02 17:28:27 -04:00
parent d5069fc1aa
commit 6a023a6f90

View file

@ -137,6 +137,13 @@ inline std::vector<OutputGroup>& GroupCoins(const std::vector<COutput>& coins)
return static_groups;
}
inline std::vector<OutputGroup>& KnapsackGroupOutputs(const CoinEligibilityFilter& filter)
{
static std::vector<OutputGroup> static_groups;
static_groups = testWallet.GroupOutputs(vCoins, coin_selection_params, filter, /* positive_only */false);
return static_groups;
}
// Branch and bound coin selection tests
BOOST_AUTO_TEST_CASE(bnb_search_test)
{