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
  1. theStack commented at 12:01 AM on November 13, 2021: member

    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.

  2. 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.
    e1d4a128e8
  3. test: refactor: rename NULLDUMMY-invalidation helper
    The name is changed to match the coding guidelines (snake case) and to
    be more descriptive.
    5ba9f1ff59
  4. 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.
    f1ed30451f
  5. DrahtBot added the label Tests on Nov 13, 2021
  6. 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_block parameters 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.

  7. laanwj commented at 9:44 AM on November 17, 2021: member

    Code review ACK f1ed30451f04af4b45b6368305722f715dcbf4fb

  8. laanwj merged this on Nov 17, 2021
  9. laanwj closed this on Nov 17, 2021

  10. theStack deleted the branch on Nov 17, 2021
  11. sidhujag referenced this in commit 84a104ffe5 on Nov 17, 2021
  12. DrahtBot locked this on Nov 17, 2022
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me