Skip to content

Commit 7e5a9d0

Browse files
DashCoreAutoGuixachow101
authored andcommitted
Merge bitcoin#26020: test: Change coinselection parameter location to make tests independent
b942c94 test: Change coinselection parameter location to make tests independent (yancy) Pull request description: the `subtract_fee_outputs` param is expected to be `true` for all subsequent tests. It should be defined outside of a single test so that if it's removed or changed, all subsequent tests won't fail. Currently if you remove this [test](https://github.com/bitcoin/bitcoin/blob/master/src/wallet/test/coinselector_tests.cpp#L304:L325) the following [test](https://github.com/bitcoin/bitcoin/blob/master/src/wallet/test/coinselector_tests.cpp#L327:L345) fails. This change makes the tests independent. ACKs for top commit: achow101: ACK b942c94 aureleoules: ACK b942c94. rajarshimaitra: tACK b942c94 theStack: ACK b942c94 Tree-SHA512: 461e19d15351318102ef9f96c68442365d8ca238c48ad7aefe23e8532b33b91dadf6c7840c7894574bccede6da162a55ad7a6f6a330d61a11ce804e68ddc5e9c Co-authored-by: Andrew Chow <github@achow101.com>
1 parent b878b1f commit 7e5a9d0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/wallet/test/coinselector_tests.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ BOOST_AUTO_TEST_CASE(bnb_search_test)
297297
/*tx_noinputs_size=*/ 0,
298298
/*avoid_partial=*/ false,
299299
};
300+
coin_selection_params_bnb.m_subtract_fee_outputs = true;
301+
300302
{
301303
std::unique_ptr<CWallet> wallet = std::make_unique<CWallet>(m_node.chain.get(), /*coinjoin_loader=*/nullptr, "", m_args, CreateMockWalletDatabase());
302304
wallet->LoadWallet();
@@ -314,7 +316,6 @@ BOOST_AUTO_TEST_CASE(bnb_search_test)
314316
coins.clear();
315317
add_coin(coins, *wallet, 1 * CENT, coin_selection_params_bnb.m_effective_feerate);
316318
coins.at(0).input_bytes = 40;
317-
coin_selection_params_bnb.m_subtract_fee_outputs = true;
318319
const auto result9 = SelectCoinsBnB(GroupCoins(coins), 1 * CENT, coin_selection_params_bnb.m_cost_of_change);
319320
BOOST_CHECK(result9);
320321
BOOST_CHECK_EQUAL(result9->GetSelectedValue(), 1 * CENT);

0 commit comments

Comments
 (0)