Skip to content

Commit 6a023a6

Browse files
committed
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.
1 parent d5069fc commit 6a023a6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/wallet/test/coinselector_tests.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ inline std::vector<OutputGroup>& GroupCoins(const std::vector<COutput>& coins)
137137
return static_groups;
138138
}
139139

140+
inline std::vector<OutputGroup>& KnapsackGroupOutputs(const CoinEligibilityFilter& filter)
141+
{
142+
static std::vector<OutputGroup> static_groups;
143+
static_groups = testWallet.GroupOutputs(vCoins, coin_selection_params, filter, /* positive_only */false);
144+
return static_groups;
145+
}
146+
140147
// Branch and bound coin selection tests
141148
BOOST_AUTO_TEST_CASE(bnb_search_test)
142149
{

0 commit comments

Comments
 (0)