aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/test/coinselector_tests.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-07-02 17:28:27 -0400
committerAndrew Chow <achow101-github@achow101.com>2021-08-27 12:46:06 -0400
commit6a023a6f904efe38dacd662d919aba74f066b1dc (patch)
tree70ddfa2f8db88433761edf9fa584e2f288823fbc /src/wallet/test/coinselector_tests.cpp
parentd5069fc1aa7d335f3043227f843cbb9d8ba1507b (diff)
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.
Diffstat (limited to 'src/wallet/test/coinselector_tests.cpp')
-rw-r--r--src/wallet/test/coinselector_tests.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/wallet/test/coinselector_tests.cpp b/src/wallet/test/coinselector_tests.cpp
index 2881825069..e83e162478 100644
--- a/src/wallet/test/coinselector_tests.cpp
+++ b/src/wallet/test/coinselector_tests.cpp
@@ -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)
{