Skip to content

Conversation

fjahr
Copy link
Contributor

@fjahr fjahr commented Jan 31, 2021

The first commit improves documentation on setup_clean_chain which is misunderstood quite frequently. Most importantly it fixes the TestShell docs which are simply incorrect.

The second commit removes the instances of setup_clean_clain in functional tests where it is not changing the default.

This used to be part of #19168 which also sought to renamesetup_clean_chain.

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

ACK

- Set the `self.setup_clean_chain` variable in `set_test_params()` to `True` if
you don't want to use the cached data directories (defaults to `False`). The
cached data directories contain a 200-block pre-mined blockchain and wallets
for four nodes. Each node has 25 mature blocks (25x50=1250 BTC) in its wallet.
Copy link
Member

Choose a reason for hiding this comment

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

Strictly speaking, it doesn't contain any wallets, only 'chainstate', 'blocks'

Copy link
Member

@jonatack jonatack Feb 1, 2021

Choose a reason for hiding this comment

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

possible alternative structure for the first sentence (so that true describes a positive action rather than a negation)

"...to True to initialize an empty blockchain, rather than load a premined blockchain from cache with the default value of False."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And wallets also doesn't have blocks in them :) I improved the clunky parts of that paragraph a bit further, taking @jonatack 's suggested sentence with a minor tweak.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

Concept ACK

- Set the `self.setup_clean_chain` variable in `set_test_params()` to `True` if
you don't want to use the cached data directories (defaults to `False`). The
cached data directories contain a 200-block pre-mined blockchain and wallets
for four nodes. Each node has 25 mature blocks (25x50=1250 BTC) in its wallet.
Copy link
Member

@jonatack jonatack Feb 1, 2021

Choose a reason for hiding this comment

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

possible alternative structure for the first sentence (so that true describes a positive action rather than a negation)

"...to True to initialize an empty blockchain, rather than load a premined blockchain from cache with the default value of False."

fjahr added 2 commits February 1, 2021 23:13
-BEGIN VERIFY SCRIPT-
git grep -l "self.setup_clean_chain = False" test/functional/*.py | xargs sed -i "/self.setup_clean_chain = False/d";
-END VERIFY SCRIPT-
@jonatack
Copy link
Member

jonatack commented Feb 1, 2021

ACK 590bda7

nit if you retouch, s/premined/pre-mined/ or choose between "premined" or "pre-mined" (both versions are used in the diff, which is my fault from my suggestion)

@maflcko maflcko merged commit ea5a50f into bitcoin:master Feb 4, 2021
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 4, 2021
Fabcien added a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 20, 2022
Summary:
```
The first commit improves documentation on setup_clean_chain which is misunderstood quite frequently. Most importantly it fixes the TestShell docs which are simply incorrect.

The second commit removes the instances of setup_clean_clain in functional tests where it is not changing the default.
```

Backport of [[bitcoin/bitcoin#21042 | core#21042]].

Test Plan:
  ninja check-functional-extended

In `test/functional`, run:
  git grep 'self.setup_clean_chain = False'
and check the is no occurrence in the test outside of the framework itself.

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D10853
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants