From 86e2a6b749c7fecbd086b361806ac9f6e9426d79 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Wed, 16 Oct 2024 13:34:15 +0100 Subject: [test] A non-standard transaction which is also consensus-invalid should return the consensus error --- test/functional/data/invalid_txs.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/functional/data/invalid_txs.py') diff --git a/test/functional/data/invalid_txs.py b/test/functional/data/invalid_txs.py index 2e4ca83bf0..d2d7202d86 100644 --- a/test/functional/data/invalid_txs.py +++ b/test/functional/data/invalid_txs.py @@ -263,6 +263,17 @@ def getDisabledOpcodeTemplate(opcode): 'valid_in_block' : True }) +class NonStandardAndInvalid(BadTxTemplate): + """A non-standard transaction which is also consensus-invalid should return the consensus error.""" + reject_reason = "mandatory-script-verify-flag-failed (OP_RETURN was encountered)" + expect_disconnect = True + valid_in_block = False + + def get_tx(self): + return create_tx_with_script( + self.spend_tx, 0, script_sig=b'\x00' * 3 + b'\xab\x6a', + amount=(self.spend_avail // 2)) + # Disabled opcode tx templates (CVE-2010-5137) DisabledOpcodeTemplates = [getDisabledOpcodeTemplate(opcode) for opcode in [ OP_CAT, -- cgit v1.2.3