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
wallet_bumpfee.py: Make sure coin selection produces change #15538
Conversation
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.
utACK 276972c
@@ -260,7 +260,9 @@ def test_unconfirmed_not_spendable(rbf_node, rbf_node_address): | |||
|
|||
|
|||
def test_bumpfee_metadata(rbf_node, dest_address): | |||
rbfid = rbf_node.sendtoaddress(dest_address, Decimal("0.00100000"), "comment value", "to value") | |||
assert(rbf_node.getbalance() < 49) |
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.
This is pretty different from the other tests, and it took me a minute to figure out how it worked.
Would add comment that spend_one_input
can't be used here because it doesn't create metadata, so getbalance check and generate call are needed to create a transaction with metadata that is guaranteed to have a change output.
Have you hit this issue in the wild? If so, mind to include a traceback? |
@@ -260,7 +260,9 @@ def test_unconfirmed_not_spendable(rbf_node, rbf_node_address): | |||
|
|||
|
|||
def test_bumpfee_metadata(rbf_node, dest_address): | |||
rbfid = rbf_node.sendtoaddress(dest_address, Decimal("0.00100000"), "comment value", "to value") | |||
assert(rbf_node.getbalance() < 49) |
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.
I'd prefer to use the assert_bla
helpers. Otherwise this is extremely difficult to debug in case of a failure.
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.
re: #15538 (comment)
I'd prefer to use the assert_bla helpers. Otherwise this is extremely difficult to debug in case of a failure.
This is making an assertion about the test environment, and if it fails it probably means there is a bug in the test setup, not a bug in bitcoin. So I thought plain assert was reasonable here. Could go either way though. (For comparison, google gunit test framework has separate ASSERT_TRUE, ASSERT_EQ macros you're supposed to use for test assertions, and CHECK, CHECK_EQ macros you're supposed to use for normal code and test setup assertions).
utACK after @MarcoFalke #15538 (comment). IIRC it was already suggested bump fee could add an input to support the increased fee - which could result in a change output. Is there something wrong with this approach? |
It's a good approach, but this PR is making a simple 3 line change to fix an invalid assumption made by a python test. Changing bumpfee to add inputs would be adding a new feature and would be a pretty indirect way of fixing a broken test. |
It's a feature I've wanted to do for a while but it required significant
refactoring to do it the Right Way previously. Hoping someone in the
residency can tackle it maybe.
…On Wed, Mar 6, 2019, 7:20 AM Russell Yanofsky ***@***.***> wrote:
IIRC it was already suggested bump fee could add an input to support the
increased fee - which could result in a change output. Is there something
wrong with this approach?
It's a good approach, but this PR is making a simple 3 line change to fix
an invalid assumption made by a python test. Changing bumpfee to add inputs
would be adding a new feature and would be a pretty indirect way of fixing
a broken test.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15538 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFgC0w0dNJtuEYV3Xl3yIYJAz4eUcbAYks5vT7JygaJpZM4be90y>
.
|
@ryanofsky sure, not saying otherwise! |
…ange 276972c wallet_bumpfee.py: Make sure coin selection produces change (Gregory Sanders) Pull request description: I was hitting the case where change-less transactions were being made. ACKs for top commit: ryanofsky: utACK 276972c Tree-SHA512: e2b7a50363daddd3ee749cacfc9d3d685a6c0c7e3e48118bb60131d205bf83ea06cdd66b69dfa3bd4dbb3bbf2b5b673d7225171486ae72fc762e5dabe2c01ef5
…uces change 276972c wallet_bumpfee.py: Make sure coin selection produces change (Gregory Sanders) Pull request description: I was hitting the case where change-less transactions were being made. ACKs for top commit: ryanofsky: utACK 276972c Tree-SHA512: e2b7a50363daddd3ee749cacfc9d3d685a6c0c7e3e48118bb60131d205bf83ea06cdd66b69dfa3bd4dbb3bbf2b5b673d7225171486ae72fc762e5dabe2c01ef5
I was hitting the case where change-less transactions were being made.