If the cost_of_change variable is removed from the method body SelectCoinsBnB, there are currently no failing unit tests. This PR adds assertions about the behavior of the cost_of_change: If the cost of creating a change output is greater than what's leftover, then consume the output and create no change, otherwise, don't consume the output (no match found).
test: Add cost_of_change parameter assertions to bnb_search_test #18195
pull yancyribbens wants to merge 1 commits into bitcoin:master from yancyribbens:add-coinselection-cost-of-change-test-cases changing 1 files +13 −0-
yancyribbens commented at 8:18 AM on February 22, 2020: contributor
- fanquake added the label Tests on Feb 22, 2020
-
MarcoFalke commented at 3:21 PM on February 22, 2020: member
re-run ci
- MarcoFalke closed this on Feb 22, 2020
- MarcoFalke reopened this on Feb 22, 2020
-
test: Add cost_of_change parameter assertions to bnb_search_test c72a11a1a0
- yancyribbens force-pushed on Feb 22, 2020
-
yancyribbens commented at 5:16 PM on February 22, 2020: contributor
removed second
add_coin(1 * CENT, 1, actual_selection);as it's not needed for the last assertion. -
DrahtBot commented at 3:14 PM on February 24, 2020: member
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--2502f1a698b3751726fa55edcda76cd3-->
Coverage
Coverage Change (pull 18195, 12fa66f329e969411251f81adf98c9b7c7b171ed) Reference (master, ab9de435880c9d77e4137b65050591ef2d14f809) Lines -0.0477 % 89.9398 % Functions -0.0888 % 85.8686 % Branches -0.0332 % 51.5553 % <sup>Updated at: 2020-02-24T15:14:56.775240.</sup>
-
Binh0103 commented at 3:55 PM on February 24, 2020: none
Perfect
- fanquake requested review from achow101 on Feb 28, 2020
- achow101 approved
-
achow101 commented at 5:36 PM on February 28, 2020: member
ACK c72a11a1a030036eb1fe4472086a9733731961ce
- MarcoFalke merged this on Feb 28, 2020
- MarcoFalke closed this on Feb 28, 2020
- sidhujag referenced this in commit 405c017457 on Feb 28, 2020
- jasonbcox referenced this in commit f67e38b0ef on Nov 10, 2020
- sidhujag referenced this in commit ea882113ec on Nov 10, 2020
- PastaPastaPasta referenced this in commit e11082b9e1 on Jun 27, 2021
- PastaPastaPasta referenced this in commit a43f0af7bd on Jun 28, 2021
- PastaPastaPasta referenced this in commit a05f813a1d on Jun 29, 2021
- PastaPastaPasta referenced this in commit c7ac7d46fc on Sep 17, 2021
- PastaPastaPasta referenced this in commit 44aef1f053 on Sep 18, 2021
- thelazier referenced this in commit b898edd07f on Sep 25, 2021
- DrahtBot locked this on Feb 15, 2022
Contributors
Labels