mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-28 13:32:53 +02:00
test: fix block tests of invalid_txs
This commit is contained in:
@@ -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):
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user