Skip to content

Commit d5069fc

Browse files
committed
tests: Use SelectCoinsBnB directly instead of AttemptSelection
Instead of calling AttemptSelection with the hopes/instruction that it uses BnB, call SelectCoinsBnB directly to test it.
1 parent 54de7b4 commit d5069fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wallet/test/coinselector_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,14 @@ BOOST_AUTO_TEST_CASE(bnb_search_test)
281281
empty_wallet();
282282
add_coin(1);
283283
vCoins.at(0).nInputBytes = 40; // Make sure that it has a negative effective value. The next check should assert if this somehow got through. Otherwise it will fail
284-
BOOST_CHECK(!testWallet.AttemptSelection( 1 * CENT, filter_standard, vCoins, setCoinsRet, nValueRet, coin_selection_params_bnb));
284+
BOOST_CHECK(!SelectCoinsBnB(GroupCoins(vCoins), 1 * CENT, coin_selection_params_bnb.m_cost_of_change, setCoinsRet, nValueRet));
285285

286286
// Test fees subtracted from output:
287287
empty_wallet();
288288
add_coin(1 * CENT);
289289
vCoins.at(0).nInputBytes = 40;
290290
coin_selection_params_bnb.m_subtract_fee_outputs = true;
291-
BOOST_CHECK(testWallet.AttemptSelection( 1 * CENT, filter_standard, vCoins, setCoinsRet, nValueRet, coin_selection_params_bnb));
291+
BOOST_CHECK(SelectCoinsBnB(GroupCoins(vCoins), 1 * CENT, coin_selection_params_bnb.m_cost_of_change, setCoinsRet, nValueRet));
292292
BOOST_CHECK_EQUAL(nValueRet, 1 * CENT);
293293

294294
// Make sure that can use BnB when there are preset inputs

0 commit comments

Comments
 (0)