aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authoryancy <yancy@yancy.lol>2022-09-06 13:56:30 +0200
committeryancy <yancy@yancy.lol>2022-09-06 13:56:30 +0200
commitb942c94d153f83b77ef5d603211252d9abadde95 (patch)
tree12e3f34ead0359484dd4bda49b7508e603f7417b /src/wallet
parent5291933fedceb9df16eb9e4627b1d7386b53ba07 (diff)
test: Change coinselection parameter location to make tests independent
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/test/coinselector_tests.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/test/coinselector_tests.cpp b/src/wallet/test/coinselector_tests.cpp
index 30a7fb9eb6..1fa54b0103 100644
--- a/src/wallet/test/coinselector_tests.cpp
+++ b/src/wallet/test/coinselector_tests.cpp
@@ -301,6 +301,8 @@ BOOST_AUTO_TEST_CASE(bnb_search_test)
coin_selection_params_bnb.m_change_fee = coin_selection_params_bnb.m_effective_feerate.GetFee(coin_selection_params_bnb.change_output_size);
coin_selection_params_bnb.m_cost_of_change = coin_selection_params_bnb.m_effective_feerate.GetFee(coin_selection_params_bnb.change_spend_size) + coin_selection_params_bnb.m_change_fee;
coin_selection_params_bnb.min_viable_change = coin_selection_params_bnb.m_effective_feerate.GetFee(coin_selection_params_bnb.change_spend_size);
+ coin_selection_params_bnb.m_subtract_fee_outputs = true;
+
{
std::unique_ptr<CWallet> wallet = std::make_unique<CWallet>(m_node.chain.get(), "", m_args, CreateMockWalletDatabase());
wallet->LoadWallet();
@@ -318,7 +320,6 @@ BOOST_AUTO_TEST_CASE(bnb_search_test)
available_coins.Clear();
add_coin(available_coins, *wallet, 1 * CENT, coin_selection_params_bnb.m_effective_feerate);
available_coins.All().at(0).input_bytes = 40;
- coin_selection_params_bnb.m_subtract_fee_outputs = true;
const auto result9 = SelectCoinsBnB(GroupCoins(available_coins.All()), 1 * CENT, coin_selection_params_bnb.m_cost_of_change);
BOOST_CHECK(result9);
BOOST_CHECK_EQUAL(result9->GetSelectedValue(), 1 * CENT);