test: fix block tests of invalid_txs
This commit is contained in:
1 parent
35bf3f8839
commit
1a689a2c88
2 files changed
+6
-2
No files matched your search
@@ -225,7 +225,6 @@ class CreateSumTooLarge(BadTxTemplate):
|
|||||||
class InvalidOPIFConstruction(BadTxTemplate):
|
class InvalidOPIFConstruction(BadTxTemplate):
|
||||||
reject_reason = "mandatory-script-verify-flag-failed (Invalid OP_IF construction)"
|
reject_reason = "mandatory-script-verify-flag-failed (Invalid OP_IF construction)"
|
||||||
expect_disconnect = True
|
expect_disconnect = True
|
||||||
valid_in_block = True
|
|
||||||
|
|
||||||
def get_tx(self):
|
def get_tx(self):
|
||||||
return create_tx_with_script(
|
return create_tx_with_script(
|
||||||
@@ -260,7 +259,7 @@ def getDisabledOpcodeTemplate(opcode):
|
|||||||
'reject_reason': "disabled opcode",
|
'reject_reason': "disabled opcode",
|
||||||
'expect_disconnect': True,
|
'expect_disconnect': True,
|
||||||
'get_tx': get_tx,
|
'get_tx': get_tx,
|
||||||
'valid_in_block' : True
|
'valid_in_block' : False
|
||||||
})
|
})
|
||||||
|
|
||||||
class NonStandardAndInvalid(BadTxTemplate):
|
class NonStandardAndInvalid(BadTxTemplate):
|
||||||
|
|||||||
@@ -153,6 +153,11 @@ class FullBlockTest(BitcoinTestFramework):
|
|||||||
for TxTemplate in invalid_txs.iter_all_templates():
|
for TxTemplate in invalid_txs.iter_all_templates():
|
||||||
template = TxTemplate(spend_tx=attempt_spend_tx)
|
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:
|
if template.valid_in_block:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user