From 6a023a6f904efe38dacd662d919aba74f066b1dc Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Fri, 2 Jul 2021 17:28:27 -0400 Subject: [PATCH] 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. --- src/wallet/test/coinselector_tests.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wallet/test/coinselector_tests.cpp b/src/wallet/test/coinselector_tests.cpp index 28818250691..e83e1624780 100644 --- a/src/wallet/test/coinselector_tests.cpp +++ b/src/wallet/test/coinselector_tests.cpp @@ -137,6 +137,13 @@ inline std::vector& GroupCoins(const std::vector& coins) return static_groups; } +inline std::vector& KnapsackGroupOutputs(const CoinEligibilityFilter& filter) +{ + static std::vector 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) {