From 5494031e8d0e1b1ff72d26205a9bb03a570b118d Mon Sep 17 00:00:00 2001 From: Donald Adu-Poku Date: Mon, 30 Jul 2018 03:28:56 +0000 Subject: [PATCH] txscript: group reserved op code tests. this groups reserved op codes and moves some dangling tests to their respective groups. --- txscript/data/script_tests.json | 196 +++++++++++++++++--------------- 1 file changed, 102 insertions(+), 94 deletions(-) diff --git a/txscript/data/script_tests.json b/txscript/data/script_tests.json index 34c33a9a95..3591014952 100644 --- a/txscript/data/script_tests.json +++ b/txscript/data/script_tests.json @@ -37,6 +37,7 @@ ["0x02aabb{2}", "DATA_2 0xaabb EQUALVERIFY DATA_2 0xaabb EQUAL", "NONE", "OK", "Raw bytes in hex notation with brace suffix are repeated"], ["{2}", "DATA_3 0xaabbcc EQUALVERIFY DATA_3 0xaabbcc EQUAL", "NONE", "OK", "Multiple tokens in angular brackets with with brace suffix are repeated"], ["<'abc'{3}>{2}", "<'abcabcabc'>{2} EQUALVERIFY EQUAL", "NONE", "OK", "'abc'{3} results in a single push of 9 bytes while <'abcabcabc'>{2} is 2 pushes of 9 bytes each"], +["0x00", "SIZE 0 EQUAL", "NONE", "OK", "Basic OP_0 execution"], ["1", "", "NONE", "OK", "Execution result with non-zero value is success"], ["0x02 0x01 0x00", "", "NONE", "OK", "All bytes are significant, not only the last one"], @@ -466,6 +467,7 @@ ["0", "IF {256} ENDIF 1", "NONE", "ERR_OP_COUNT", ">255 opcodes including non-executed IF branch"], ["1 IF", "1 ENDIF", "NONE", "ERR_UNBALANCED_CONDITIONAL", "IF/ENDIF can't span scriptSig/scriptPubKey"], ["1 IF 0 ENDIF", "1 ENDIF", "NONE", "ERR_UNBALANCED_CONDITIONAL"], +["1 IF 1 ELSE", "0xff ENDIF", "NONE", "ERR_UNBALANCED_CONDITIONAL", "Invalid because scriptSig and scriptPubKey are processed separately"], ["Unevaluated non-minimal pushes are ignored"], ["0 IF 0x4c 0x00 ENDIF 1", "", "NONE", "OK", "non-minimal PUSHDATA1 ignored"], @@ -562,6 +564,7 @@ ["TOALTSTACK/FROMALTSTACK test coverage"], ["10 0 11 TOALTSTACK DROP FROMALTSTACK", "ADD 21 EQUAL", "NONE", "OK"], +["1 TOALTSTACK 2 TOALTSTACK 3 4 5 0x6f{172}", "1 2 3 4 5 6 7 0x6f{166}", "NONE", "OK", "1,024 stack size (altstack cleared between scriptSig/scriptPubKey)"], ["'gavin_was_here' TOALTSTACK 11 FROMALTSTACK", "'gavin_was_here' EQUALVERIFY 11 EQUAL", "NONE", "OK"], ["0", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK 0 EQUAL", "NONE", "OK", "OP_0 must be able to round trip alt data stack"], ["DATA_1 0x7a", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_1 0x7a EQUAL", "NONE", "OK", "1-byte pushes must be able to round trip alt data stack"], @@ -674,6 +677,7 @@ ["-1 0 1 2", "3DUP DEPTH 7 EQUALVERIFY {2} 3 EQUALVERIFY 2DROP 0 EQUALVERIFY", "NONE", "OK"], ["1 2 3 4 5 <3DUP>{173}", "1 2 3 4 5 6 <3DUP>{165}", "NONE", "ERR_STACK_SIZE", ">1,024 stack size"], ["1 2 3 4 5 <3DUP>{172}", "1 TOALTSTACK 2 TOALTSTACK 3 4 5 6 <3DUP>{166}", "NONE", "ERR_STACK_SIZE", ">1,024 stack+altstack size"], +["1 2 3 4 5 0x6f{172}", "1 2 3 4 5 0x6f{166}", "NONE", "OK", "1,024 stack size (0x6f is 3DUP)"], ["2OVER test coverage"], ["NOP", "2OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2OVER requires four items on the stack and NOP must not be treated as one"], @@ -1134,6 +1138,9 @@ ["-9223372036854775807", "0x08 0xFFFFFFFFFFFFFFFF EQUAL", "NONE", "OK"], ["1", "EQUAL 1", "NONE", "ERR_INVALID_STACK_OPERATION"], ["0 0 1", "EQUAL EQUAL", "NONE", "OK", "OP_0 and bools must have identical byte representations"], +["0x00", "'00' EQUAL", "NONE", "ERR_EVAL_FALSE", "Basic OP_0 execution"], +["1", "0x02 0x0100 EQUAL NOT", "NONE", "OK", "Not the same byte array..."], +["0", "0x01 0x80 EQUAL NOT", "NONE", "OK"], ["", "EQUAL 1", "NONE", "ERR_INVALID_STACK_OPERATION", "EQUAL must error when there are no stack items"], ["0", "EQUAL 1", "NONE", "ERR_INVALID_STACK_OPERATION", "EQUAL must error when there are not 2 stack items"], ["0 1","EQUAL", "NONE", "ERR_EVAL_FALSE"], @@ -1693,73 +1700,6 @@ ["1","NOP1 CHECKLOCKTIMEVERIFY NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 1 EQUAL", "NONE", "OK"], ["'NOP_1_to_10' NOP1 CHECKLOCKTIMEVERIFY NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_10' EQUAL", "NONE", "OK"], -["1", "NOP", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discourage NOPx flag allows OP_NOP"], - -["0", "IF NOP1 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP1 allowed if not executed"], -["0", "IF NOP2 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP2 allowed if not executed when CLTV is inactive"], -["0", "IF NOP3 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP3 allowed if not executed when CSV is inactive"], -["0", "IF NOP4 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP4 allowed if not executed"], -["0", "IF NOP5 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP5 allowed if not executed"], -["0", "IF NOP6 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP6 allowed if not executed"], -["0", "IF NOP7 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP7 allowed if not executed"], -["0", "IF NOP8 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP8 allowed if not executed"], -["0", "IF NOP9 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP9 allowed if not executed"], -["0", "IF NOP10 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP10 allowed if not executed"], -["0", "IF 0xc0 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc0 allowed if not executed when SHA256 is inactive"], -["0", "IF 0xc1 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc1 allowed if not executed"], -["0", "IF 0xc2 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc2 allowed if not executed"], -["0", "IF 0xc3 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc3 allowed if not executed"], -["0", "IF 0xc4 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc4 allowed if not executed"], -["0", "IF 0xc5 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc5 allowed if not executed"], -["0", "IF 0xc6 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc6 allowed if not executed"], -["0", "IF 0xc7 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc7 allowed if not executed"], -["0", "IF 0xc8 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc8 allowed if not executed"], -["0", "IF 0xc9 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc9 allowed if not executed"], -["0", "IF 0xca ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xca allowed if not executed"], -["0", "IF 0xcb ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xcb allowed if not executed"], -["0", "IF 0xcc ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xcc allowed if not executed"], -["0", "IF 0xcd ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xcd allowed if not executed"], -["0", "IF 0xce ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xce allowed if not executed"], -["0", "IF 0xcf ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xcf allowed if not executed"], -["0", "IF 0xd0 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd0 allowed if not executed"], -["0", "IF 0xd1 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd1 allowed if not executed"], -["0", "IF 0xd2 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd2 allowed if not executed"], -["0", "IF 0xd3 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd3 allowed if not executed"], -["0", "IF 0xd4 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd4 allowed if not executed"], -["0", "IF 0xd5 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd5 allowed if not executed"], -["0", "IF 0xd6 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd6 allowed if not executed"], -["0", "IF 0xd7 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd7 allowed if not executed"], -["0", "IF 0xd8 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd8 allowed if not executed"], -["0", "IF 0xd9 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd9 allowed if not executed"], -["0", "IF 0xda ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xda allowed if not executed"], -["0", "IF 0xdb ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xdb allowed if not executed"], -["0", "IF 0xdc ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xdc allowed if not executed"], -["0", "IF 0xdd ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xdd allowed if not executed"], -["0", "IF 0xde ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xde allowed if not executed"], -["0", "IF 0xdf ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xdf allowed if not executed"], -["0", "IF 0xe0 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe0 allowed if not executed"], -["0", "IF 0xe1 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe1 allowed if not executed"], -["0", "IF 0xe2 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe2 allowed if not executed"], -["0", "IF 0xe3 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe3 allowed if not executed"], -["0", "IF 0xe4 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe4 allowed if not executed"], -["0", "IF 0xe5 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe5 allowed if not executed"], -["0", "IF 0xe6 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe6 allowed if not executed"], -["0", "IF 0xe7 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe7 allowed if not executed"], -["0", "IF 0xe8 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe8 allowed if not executed"], -["0", "IF 0xe9 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe9 allowed if not executed"], -["0", "IF 0xea ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xea allowed if not executed"], -["0", "IF 0xeb ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xeb allowed if not executed"], -["0", "IF 0xec ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xec allowed if not executed"], -["0", "IF 0xed ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xed allowed if not executed"], - -["0", "IF 0x50 ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0x50 allowed if not executed"], -["0", "IF 0xfa ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfa allowed if not executed"], -["0", "IF 0xfb ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfb allowed if not executed"], -["0", "IF 0xfc ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfc allowed if not executed"], -["0", "IF 0xfd ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfd allowed if not executed"], -["0", "IF 0xfe ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfe allowed if not executed"], -["0", "IF 0xff ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xff allowed if not executed"], - ["NOP", "'b'{2048}", "NONE", "OK", "2048 byte push"], ["1", "0x61{255}", "NONE", "OK", "255 opcodes executed. 0x61 is NOP"], ["1 2 3 4 5 0x6f{172}", "1 2 3 4 5 0x6f{166}", "NONE", "OK", "1,024 stack size (0x6f is 3DUP)"], @@ -1770,7 +1710,6 @@ ["0", "IF 0x50{255} ENDIF 1", "NONE", "OK", ">255 opcodes, but RESERVED (0x50) doesn't count towards opcode limit"], -["NOP","1", "NONE", "OK"], ["1", "0x02 0x0100 EQUAL NOT", "NONE", "OK", "Not the same byte array..."], ["0", "0x01 0x80 EQUAL NOT", "NONE", "OK"], @@ -2684,8 +2623,36 @@ ["", "0 <0>{19} 19 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "NONE", "OK", "CHECKMULTISIGVERIFY must allow 19 pubkeys"], ["", "0 <0>{20} 20 CHECKMULTISIGVERIFY DEPTH 0 EQUAL", "NONE", "OK", "CHECKMULTISIGVERIFY must allow 20 pubkeys"], +["Reserved opcode tests"], + +["NOP test coverage"], +["NOP","1", "NONE", "OK"], +["NOP", "'b'{2048}", "NONE", "OK", "2048 byte push"], +["NOP", "'b'{2049}", "NONE", "ERR_PUSH_SIZE", ">2048 byte push"], +["1", "{256}", "NONE", "ERR_OP_COUNT", ">255 opcodes executed"], ["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 SSTX SSGEN SSRTX 2 EQUAL", "NONE", "ERR_EVAL_FALSE"], ["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 SSTX SSGEN SSRTX","'NOP_1_to_11' EQUAL", "NONE", "ERR_EVAL_FALSE"], +["1", "0x61{255}", "NONE", "OK", "255 opcodes executed. 0x61 is NOP"], +["1", "NOP", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discourage NOPx flag allows OP_NOP"], +["NOP", "0 'a'{2048} <'b'{2048}>{6} 'b'{2024}", "NONE", "ERR_SCRIPT_SIZE", "16385-byte scriptPubKey"], +["'a'{2048} 'b'{2048} 'b'{2048} 'b'{2048} 'b'{2048} 'b'{2048} 'b'{2048} 'b'{1764} 1 2 3 4 5 0x6f{255}", + "'a'{2048} 'b'{2048} 'b'{2048} 'b'{2048} 'b'{2048} 'b'{2048} 'b'{2048} 'b'{1786} 1 2 3 4 0x6f{78}", "NONE", "OK", + "Max-size (16384 bytes), max-push (2048 bytes), max-opcodes (255), max stack size (1024 items). 0x6f is 3DUP, 0x61 is NOP"], + +["NOP1...NOP10 test coverage"], +["NOP", "NOP1 1", "NONE", "OK"], +["NOP", "CHECKLOCKTIMEVERIFY 1", "NONE", "OK"], +["NOP", "NOP3 1", "NONE", "OK"], +["NOP", "NOP4 1", "NONE", "OK"], +["NOP", "NOP5 1", "NONE", "OK"], +["NOP", "NOP6 1", "NONE", "OK"], +["NOP", "NOP7 1", "NONE", "OK"], +["NOP", "NOP8 1", "NONE", "OK"], +["NOP", "NOP9 1", "NONE", "OK"], +["NOP", "NOP10 1", "NONE", "OK"], +["NOP1","NOP10", "NONE", "ERR_EMPTY_STACK"], +["NOP 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "NONE", "ERR_SIG_PUSHONLY", "Tests for Script.IsPushOnly()"], +["NOP1 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "NONE", "ERR_SIG_PUSHONLY"], ["Ensure 100% coverage of discouraged NOPS"], ["1", "NOP1", "DISCOURAGE_UPGRADABLE_NOPS", "ERR_DISCOURAGE_UPGRADABLE_NOPS", "Opcode 0xb0 is a discouraged NOP"], @@ -2756,10 +2723,67 @@ ["1", "0xf7", "DISCOURAGE_UPGRADABLE_NOPS", "ERR_DISCOURAGE_UPGRADABLE_NOPS", "Opcode 0xf7 is a discouraged NOP"], ["1", "0xf8", "DISCOURAGE_UPGRADABLE_NOPS", "ERR_DISCOURAGE_UPGRADABLE_NOPS", "Opcode 0xf8 is a discouraged NOP"], -["NOP10", "1", "DISCOURAGE_UPGRADABLE_NOPS", "ERR_DISCOURAGE_UPGRADABLE_NOPS", "Discouraged NOP10 in scriptSig"], +["0", "IF NOP1 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP1 allowed if not executed"], +["0", "IF NOP2 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP2 allowed if not executed when CLTV is inactive"], +["0", "IF NOP3 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP3 allowed if not executed when CSV is inactive"], +["0", "IF NOP4 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP4 allowed if not executed"], +["0", "IF NOP5 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP5 allowed if not executed"], +["0", "IF NOP6 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP6 allowed if not executed"], +["0", "IF NOP7 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP7 allowed if not executed"], +["0", "IF NOP8 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP8 allowed if not executed"], +["0", "IF NOP9 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP9 allowed if not executed"], +["0", "IF NOP10 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged NOP10 allowed if not executed"], +["0", "IF 0xc0 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc0 allowed if not executed when SHA256 is inactive"], +["0", "IF 0xc1 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc1 allowed if not executed"], +["0", "IF 0xc2 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc2 allowed if not executed"], +["0", "IF 0xc3 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc3 allowed if not executed"], +["0", "IF 0xc4 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc4 allowed if not executed"], +["0", "IF 0xc5 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc5 allowed if not executed"], +["0", "IF 0xc6 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc6 allowed if not executed"], +["0", "IF 0xc7 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc7 allowed if not executed"], +["0", "IF 0xc8 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc8 allowed if not executed"], +["0", "IF 0xc9 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xc9 allowed if not executed"], +["0", "IF 0xca ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xca allowed if not executed"], +["0", "IF 0xcb ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xcb allowed if not executed"], +["0", "IF 0xcc ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xcc allowed if not executed"], +["0", "IF 0xcd ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xcd allowed if not executed"], +["0", "IF 0xce ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xce allowed if not executed"], +["0", "IF 0xcf ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xcf allowed if not executed"], +["0", "IF 0xd0 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd0 allowed if not executed"], +["0", "IF 0xd1 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd1 allowed if not executed"], +["0", "IF 0xd2 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd2 allowed if not executed"], +["0", "IF 0xd3 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd3 allowed if not executed"], +["0", "IF 0xd4 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd4 allowed if not executed"], +["0", "IF 0xd5 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd5 allowed if not executed"], +["0", "IF 0xd6 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd6 allowed if not executed"], +["0", "IF 0xd7 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd7 allowed if not executed"], +["0", "IF 0xd8 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd8 allowed if not executed"], +["0", "IF 0xd9 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xd9 allowed if not executed"], +["0", "IF 0xda ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xda allowed if not executed"], +["0", "IF 0xdb ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xdb allowed if not executed"], +["0", "IF 0xdc ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xdc allowed if not executed"], +["0", "IF 0xdd ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xdd allowed if not executed"], +["0", "IF 0xde ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xde allowed if not executed"], +["0", "IF 0xdf ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xdf allowed if not executed"], +["0", "IF 0xe0 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe0 allowed if not executed"], +["0", "IF 0xe1 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe1 allowed if not executed"], +["0", "IF 0xe2 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe2 allowed if not executed"], +["0", "IF 0xe3 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe3 allowed if not executed"], +["0", "IF 0xe4 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe4 allowed if not executed"], +["0", "IF 0xe5 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe5 allowed if not executed"], +["0", "IF 0xe6 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe6 allowed if not executed"], +["0", "IF 0xe7 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe7 allowed if not executed"], +["0", "IF 0xe8 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe8 allowed if not executed"], +["0", "IF 0xe9 ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xe9 allowed if not executed"], +["0", "IF 0xea ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xea allowed if not executed"], +["0", "IF 0xeb ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xeb allowed if not executed"], +["0", "IF 0xec ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xec allowed if not executed"], +["0", "IF 0xed ENDIF 1", "DISCOURAGE_UPGRADABLE_NOPS", "OK", "Discouraged nop opcode 0xed allowed if not executed"], +["NOP10", "1", "DISCOURAGE_UPGRADABLE_NOPS", "ERR_DISCOURAGE_UPGRADABLE_NOPS", "Discouraged NOP10 in scriptSig"], ["1 0x01 NOP10", "HASH160 0x14 0xa880c3383e77efb97808a87ca378539e5f8904ef EQUAL", "DISCOURAGE_UPGRADABLE_NOPS", "ERR_DISCOURAGE_UPGRADABLE_NOPS", "Discouraged NOP10 in redeemScript"], +["RESERVED test coverage"], ["0x50","1", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0x50 is reserved"], ["0xfa", "1", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0xfa is reserved"], ["0xfb", "1", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0xfb is reserved"], @@ -2768,6 +2792,14 @@ ["0xfe", "1", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0xfe is reserved"], ["0xff", "1", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0xff is reserved"], +["0", "IF 0x50 ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0x50 allowed if not executed"], +["0", "IF 0xfa ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfa allowed if not executed"], +["0", "IF 0xfb ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfb allowed if not executed"], +["0", "IF 0xfc ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfc allowed if not executed"], +["0", "IF 0xfd ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfd allowed if not executed"], +["0", "IF 0xfe ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xfe allowed if not executed"], +["0", "IF 0xff ELSE 1 ENDIF", "NONE", "OK", "Reserved opcode 0xff allowed if not executed"], + ["1 1","IF 0x50 ELSE ENDIF", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0x50 is reserved in executed branch"], ["1 1","IF 0xfa ELSE ENDIF", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0xfa is reserved in executed branch"], ["1 1","IF 0xfb ELSE ENDIF", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0xfb is reserved in executed branch"], @@ -2776,31 +2808,7 @@ ["1 1","IF 0xfe ELSE ENDIF", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0xfe is reserved in executed branch"], ["1 1","IF 0xff ELSE ENDIF", "NONE", "ERR_RESERVED_OPCODE", "Opcode 0xff is reserved in executed branch"], -["1 IF 1 ELSE", "0xff ENDIF", "NONE", "ERR_UNBALANCED_CONDITIONAL", "Invalid because scriptSig and scriptPubKey are processed separately"], - -["NOP", "RIPEMD160", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "SHA1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "SHA256", "SHA256", "ERR_INVALID_STACK_OPERATION"], -["NOP", "BLAKE256", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "HASH160", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "HASH256", "NONE", "ERR_INVALID_STACK_OPERATION"], - -["NOP", "'b'{2049}", "NONE", "ERR_PUSH_SIZE", ">2048 byte push"], -["1", "{256}", "NONE", "ERR_OP_COUNT", ">255 opcodes executed"], -["NOP", "0 'a'{2048} <'b'{2048}>{6} 'b'{2024}", "NONE", "ERR_SCRIPT_SIZE", "16385-byte scriptPubKey"], - -["NOP1","NOP10", "NONE", "ERR_EMPTY_STACK"], - -["NOP", "RIPEMD160 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "SHA1 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "SHA256 1", "SHA256", "ERR_INVALID_STACK_OPERATION"], -["0", "SHA256", "NONE", "ERR_EVAL_FALSE", "Treated as NOP since it doesn't set SHA256 script flag"], -["NOP", "BLAKE256 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "HASH160 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "HASH256 1", "NONE", "ERR_INVALID_STACK_OPERATION"], - -["NOP 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "NONE", "ERR_SIG_PUSHONLY", "Tests for Script.IsPushOnly()"], -["NOP1 0x01 1", "HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL", "NONE", "ERR_SIG_PUSHONLY"], +["0", "IF 0x50{255} ENDIF 1", "NONE", "OK", ">255 opcodes, but RESERVED (0x50) doesn't count towards opcode limit"], ["0 0x01 0x50", "HASH160 0x14 0x77c33ee1f1892b124f2c9aaed62114c23cffe2da EQUAL", "NONE", "ERR_RESERVED_OPCODE", "OP_RESERVED in P2SH should fail"], ["0 0x01 VER", "HASH160 0x14 0xe682277f7669fe986d315d52b56df3d244da11a0 EQUAL", "NONE", "ERR_RESERVED_OPCODE", "OP_VER in P2SH should fail"],