This PR improves the functional test feature_nulldummy.py by simplifying the helpers trueDummy (renamed to invalidate_nulldummy_tx) and block_submit. Details can be found in the commit messages.
test: various feature_nulldummy.py improvements #23501
pull theStack wants to merge 3 commits into bitcoin:master from theStack:202111-test-nulldummy_improvements changing 1 files +12 −19-
theStack commented at 12:01 AM on November 13, 2021: member
-
e1d4a128e8
test: simplify and document NULLDUMMY-invalidation helper
The function `trueDummy` in feature_nulldummy.py is currently more complicated than it needs to be. Rather than converting the scriptSig to a CScript and looping through it to build a new scriptSig with the modified push, simply directly replace the push of null (OP_0) with a push of one (OP_TRUE/OP_1). Note that on master, actually an element with the value of 0x51 is pushed (0x0151...) -- this was very likely not intended, as 0x51 is the script op-code for OP_TRUE, and also the function's name suggests that the "true" value shall be pushed.
-
5ba9f1ff59
test: refactor: rename NULLDUMMY-invalidation helper
The name is changed to match the coding guidelines (snake case) and to be more descriptive.
-
f1ed30451f
test: refactor: simplify `block_submit` in feature_nulldummy.py
The `create_block` helper accepts a list of txs that it includes in the created block, hence we don't have to do that manually. Also, rehashing before solving the block is not needed and can be removed.
- DrahtBot added the label Tests on Nov 13, 2021
-
DrahtBot commented at 1:11 AM on November 13, 2021: member
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #23521 (test: refactor: dedup code by taking use of
create_blockparameters by theStack) - #23127 (tests: Use test framework utils where possible by vincenzopalazzo)
- #20892 (tests: Run both descriptor and legacy tests within a single test invocation by achow101)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
- #23521 (test: refactor: dedup code by taking use of
-
laanwj commented at 9:44 AM on November 17, 2021: member
Code review ACK f1ed30451f04af4b45b6368305722f715dcbf4fb
- laanwj merged this on Nov 17, 2021
- laanwj closed this on Nov 17, 2021
- theStack deleted the branch on Nov 17, 2021
- sidhujag referenced this in commit 84a104ffe5 on Nov 17, 2021
- DrahtBot locked this on Nov 17, 2022