-
Notifications
You must be signed in to change notification settings - Fork 38.6k
test: Add remaining scenarios of 0 waste, in wallet waste_test #22938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2421018 to
c976ee0
Compare
|
Concept ACK |
|
Concept ACK
Strictly speaking it should be:
|
|
ACK c976ee0a0ca00fe8a7de5c806560da35c2f48729 |
murchandamus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a nit on the comment explaining the test
c976ee0 to
0ce3301
Compare
|
Thanks @xekyo for the review and agreed. It should be reversed. Updated everywhere.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 0ce33016eb905f5ac3709ed95ae02db0f97885a2
Perhaps update the commit message and pull description with @xekyo's calculations in #22938 (comment). Edit: never mind, it seems fine now IIUC.
|
ACK 0ce33016eb905f5ac3709ed95ae02db0f97885a2 |
0ce3301 to
a2a9c23
Compare
|
Thanks @jonatack for the review. Those were good suggestions. Updated the comment description. |
|
Re-ack a2a9c23 |
jonatack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review re-ACK a2a9c23e261ad88c0133b407c6e1b4c54f90a860 per git diff 0ce3301 a2a9c23
Sub-atomic consistency nits, but definitely ignore unless you have to rebase or something (and maybe even then).
There are two more cases where waste can be 0, when: - (Fee - LTF) == -Change Cost - (Fee - LTF) == -Excess Adding these two conditions explicitly in the unit test will help pin the behavior, also demonstrate waste calculation scenarios to new readers.
a2a9c23 to
efcaefc
Compare
|
@jonatack Sorry for my silly overlooks.. Updated now only.. |
|
Tested re-ACK efcaefc |
|
ACK efcaefc |
meshcollider
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK efcaefc
As per the review club discussion on #22009 , it was observed that there were other two fee scenarios in which selection waste could be zero.
These are:
Even though these are obvious by the definition of waste metric, adding tests for them can be helpful in explaining its behavior
to new readers of the code base, along with pinning the behavior for future.
This PR adds those two cases to waste calculation unit test.
Also let me know if I am missing more scenarios.