Three new tests have been added.
- More coins should be selected when effective fee < long term fee.
- Less coin should be selected when effective fee > long term fee.
- If a coin is preselected, it should be selected even if disadvantageous.
Three new tests have been added.
@brunoerg @MarcoFalke @achow101 could you please review it, as it would be helpful for my summer of bitcoin proposal.
376 | + std::vector<COutput> coins; 377 | + 378 | + expected_result.Clear(); 379 | + add_coin(coins, *wallet, 10 * CENT, 6 * 24, false, 0, true); 380 | + add_coin(coins, *wallet, 9 * CENT, 6 * 24, false, 0, true); 381 | + add_coin(coins, *wallet, 1 * CENT, 6 * 24, false, 0, true);
In 5c15850ded2a3195fae0dd238e1aebaaa46b13ce "3 new tests for SelectCoins function"
All of this setup is the same in all three test cases. These can be deduplicated and just have a single scope for all these cases.
made these changes.
Please squash your commits according to https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#squashing-commits
Given this hasn't been re-reviewed yet, I'd suggest improving your commit message. It should follow a similar form to the PR title / description, a title, followed by a newline, and then a description of the change. Irrelevant things like "removed duplicate setup from tests", should be dropped. i.e:
test: add 3 new test cases for SelectCoins()
1. More coins should be selected when effective fee < long term fee.
2. Less coin should be selected when effective fee > long term fee.
3. If a coin is preselected, it should be selected even if disadvantageous.
1. More coins should be selected when effective fee < long term fee.
2. Less coin should be selected when effective fee > long term fee.
3. If a coin is preselected, it should be selected even if disadvantageous.
ACK 3f8def51d53a078a5ee71ec675b5e06b784147de
ACK 3f8def51d53a078a5ee71ec675b5e06b784147de
Nice adds!