Skip to content

test: wallet: add coverage for -spendzeroconfchange setting - #26884

Merged
maflcko merged 2 commits into
bitcoin:masterfrom
theStack:202301-test-add_nospendzeroconfchange_coverage
Jan 17, 2023
Merged

maflcko merged 2 commits into
bitcoin:masterfrom
theStack:202301-test-add_nospendzeroconfchange_coverage

Conversation

@theStack

@theStack theStack commented Jan 13, 2023 •

Copy link
Copy Markdown
Contributor

This PR adds missing test coverage for the -spendzeroconfchange setting (in particular the non-default case =0). Note that in contrast to the name, the setting does not only apply to change outputs, but in fact to all unconfirmed outputs that we sent to ourselves, i.e. we can trigger the testing path simply with a single recipient address. The first commit removes the setting from the functional test mempool_limit.py, where it doesn't have any effect, since the test was changed to use MiniWallet in commit dddca38.

Since this test was changed to use MiniWallet instead of the Bitcoin
Core wallet (see commit d447ded),
the setting doesn't have any effect and hence can be removed.
@DrahtBot

DrahtBot commented Jan 13, 2023 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK brunoerg

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Tests label Jan 13, 2023

@brunoerg brunoerg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

@brunoerg

Copy link
Copy Markdown
Contributor

I think we could also test the behavior of getbalance with spendzeroconfchange.

@theStack
theStack force-pushed the 202301-test-add_nospendzeroconfchange_coverage branch from 4c046f6 to 603d295 Compare January 13, 2023 20:57
@theStack

Copy link
Copy Markdown
Contributor Author

I think we could also test the behavior of getbalance with spendzeroconfchange.

Good idea, done. Used getbalances rather than getbalance to check in which category unconfirmed self-sent coins fall (trusted or untrusted_pending) depending on the -spendzeroconfchange setting.

@brunoerg brunoerg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crACK 603d295

Nice!

@maflcko
maflcko merged commit 635f190 into bitcoin:master Jan 17, 2023
@theStack
theStack deleted the 202301-test-add_nospendzeroconfchange_coverage branch January 17, 2023 10:40
@bitcoin bitcoin locked and limited conversation to collaborators Jan 17, 2024
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.

4 participants