Skip to content
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

Merged
merged 1 commit into from Jul 2, 2019

Conversation

instagibbs
Copy link
Member

I was hitting the case where change-less transactions were being made.

Copy link
Contributor

@ryanofsky ryanofsky left a 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)
Copy link
Contributor

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.

@maflcko
Copy link
Member

maflcko commented Mar 5, 2019

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)
Copy link
Member

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.

Copy link
Contributor

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).

@fanquake fanquake added the Tests label Mar 5, 2019
@promag
Copy link
Member

promag commented Mar 6, 2019

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?

@ryanofsky
Copy link
Contributor

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.

@instagibbs
Copy link
Member Author

instagibbs commented Mar 6, 2019 via email

@promag
Copy link
Member

promag commented Mar 6, 2019

@ryanofsky sure, not saying otherwise!

@laanwj laanwj merged commit 276972c into bitcoin:master Jul 2, 2019
laanwj added a commit that referenced this pull request Jul 2, 2019
…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
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 3, 2019
…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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants