test: fix and augment block tests of invalid_txs #32591

pull instagibbs wants to merge 2 commits into bitcoin:master from instagibbs:2025-05-fix_invalidtx_test changing 2 files +12 −2
  1. instagibbs commented at 2:45 pm on May 22, 2025: member

    We are not actually testing some cases accidentally, for block inclusion.

    Issue discovered while reviewing https://github.com/bitcoin/bitcoin/pull/32533

  2. test: fix block tests of invalid_txs 1a689a2c88
  3. test: ensure reason is checked for invalid blocks rejection 8fcd684505
  4. DrahtBot commented at 2:45 pm on May 22, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32591.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK theStack

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

  5. DrahtBot added the label Tests on May 22, 2025
  6. theStack commented at 2:49 pm on May 22, 2025: contributor
    Concept ACK, good catch!
  7. in test/functional/data/invalid_txs.py:262 in 1a689a2c88 outdated
    258@@ -260,7 +259,7 @@ def get_tx(self):
    259         'reject_reason': "disabled opcode",
    260         'expect_disconnect': True,
    261         'get_tx': get_tx,
    262-        'valid_in_block' : True
    263+        'valid_in_block' : False
    


    theStack commented at 2:43 pm on May 23, 2025:
    nit: alternatively, could just remove the line since False is the default anyways, but no blocker
  8. theStack approved
  9. theStack commented at 2:45 pm on May 23, 2025: contributor

    ACK 8fcd6845052354fad80ae7e5feda3f6a2e441e12

    Diff of feature_block.py test runs between merge-base and PR (patched out the timestamps from the logging formatter in order to compare):

     0> TestFramework (INFO): Reject block with invalid tx: InvalidOPIFConstruction
     114a16,30
     2> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_CAT
     3> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_SUBSTR
     4> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_LEFT
     5> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_RIGHT
     6> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_INVERT
     7> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_AND
     8> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_OR
     9> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_XOR
    10> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_2MUL
    11> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_2DIV
    12> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_MUL
    13> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_DIV
    14> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_MOD
    15> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_LSHIFT
    16> TestFramework (INFO): Reject block with invalid tx: DisabledOpcode_OP_RSHIFT
    

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: 2025-05-25 18:12 UTC

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