test: fix block tests of invalid_txs

This commit is contained in:
Greg Sanders
2025-05-22 10:30:13 -04:00
parent 35bf3f8839
commit 1a689a2c88
2 changed files with 6 additions and 2 deletions

View File

@@ -225,7 +225,6 @@ class CreateSumTooLarge(BadTxTemplate):
class InvalidOPIFConstruction(BadTxTemplate):
reject_reason = "mandatory-script-verify-flag-failed (Invalid OP_IF construction)"
expect_disconnect = True
valid_in_block = True
def get_tx(self):
return create_tx_with_script(
@@ -260,7 +259,7 @@ def getDisabledOpcodeTemplate(opcode):
'reject_reason': "disabled opcode",
'expect_disconnect': True,
'get_tx': get_tx,
'valid_in_block' : True
'valid_in_block' : False
})
class NonStandardAndInvalid(BadTxTemplate):

View File

@@ -153,6 +153,11 @@ class FullBlockTest(BitcoinTestFramework):
for TxTemplate in invalid_txs.iter_all_templates():
template = TxTemplate(spend_tx=attempt_spend_tx)
# belt-and-suspenders checking we won't pass up validating something
# we expect a disconnect from
if template.expect_disconnect:
assert not template.valid_in_block
if template.valid_in_block:
continue