Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add coverage for all invalid ops

0xba thru 0xff
  • Loading branch information...
commit 6131d1d9dfadc9e78e64574209a8014dcb4c8244 1 parent 0bd573d
@petertodd petertodd authored
Showing with 131 additions and 1 deletion.
  1. +67 −1 src/test/data/script_invalid.json
  2. +64 −0 src/test/data/script_valid.json
View
68 src/test/data/script_invalid.json
@@ -128,13 +128,79 @@
["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_11' EQUAL"],
["0x50","1", "opcode 0x50 is reserved"],
-["1", "IF 0xba ELSE 1 ENDIF", "opcodes above NOP10 invalid"],
+["1", "IF 0xba ELSE 1 ENDIF", "opcodes above NOP10 invalid if executed"],
+["1", "IF 0xbb ELSE 1 ENDIF"],
+["1", "IF 0xbc ELSE 1 ENDIF"],
+["1", "IF 0xbd ELSE 1 ENDIF"],
+["1", "IF 0xbe ELSE 1 ENDIF"],
+["1", "IF 0xbf ELSE 1 ENDIF"],
["1", "IF 0xc0 ELSE 1 ENDIF"],
+["1", "IF 0xc1 ELSE 1 ENDIF"],
+["1", "IF 0xc2 ELSE 1 ENDIF"],
+["1", "IF 0xc3 ELSE 1 ENDIF"],
+["1", "IF 0xc4 ELSE 1 ENDIF"],
+["1", "IF 0xc5 ELSE 1 ENDIF"],
+["1", "IF 0xc6 ELSE 1 ENDIF"],
+["1", "IF 0xc7 ELSE 1 ENDIF"],
+["1", "IF 0xc8 ELSE 1 ENDIF"],
+["1", "IF 0xc9 ELSE 1 ENDIF"],
+["1", "IF 0xca ELSE 1 ENDIF"],
+["1", "IF 0xcb ELSE 1 ENDIF"],
+["1", "IF 0xcc ELSE 1 ENDIF"],
+["1", "IF 0xcd ELSE 1 ENDIF"],
+["1", "IF 0xce ELSE 1 ENDIF"],
+["1", "IF 0xcf ELSE 1 ENDIF"],
+["1", "IF 0xd0 ELSE 1 ENDIF"],
["1", "IF 0xd1 ELSE 1 ENDIF"],
+["1", "IF 0xd2 ELSE 1 ENDIF"],
+["1", "IF 0xd3 ELSE 1 ENDIF"],
+["1", "IF 0xd4 ELSE 1 ENDIF"],
+["1", "IF 0xd5 ELSE 1 ENDIF"],
+["1", "IF 0xd6 ELSE 1 ENDIF"],
+["1", "IF 0xd7 ELSE 1 ENDIF"],
+["1", "IF 0xd8 ELSE 1 ENDIF"],
+["1", "IF 0xd9 ELSE 1 ENDIF"],
+["1", "IF 0xda ELSE 1 ENDIF"],
+["1", "IF 0xdb ELSE 1 ENDIF"],
+["1", "IF 0xdc ELSE 1 ENDIF"],
+["1", "IF 0xdd ELSE 1 ENDIF"],
+["1", "IF 0xde ELSE 1 ENDIF"],
+["1", "IF 0xdf ELSE 1 ENDIF"],
+["1", "IF 0xe0 ELSE 1 ENDIF"],
+["1", "IF 0xe1 ELSE 1 ENDIF"],
+["1", "IF 0xe2 ELSE 1 ENDIF"],
+["1", "IF 0xe3 ELSE 1 ENDIF"],
+["1", "IF 0xe4 ELSE 1 ENDIF"],
+["1", "IF 0xe5 ELSE 1 ENDIF"],
+["1", "IF 0xe6 ELSE 1 ENDIF"],
+["1", "IF 0xe7 ELSE 1 ENDIF"],
+["1", "IF 0xe8 ELSE 1 ENDIF"],
+["1", "IF 0xe9 ELSE 1 ENDIF"],
+["1", "IF 0xea ELSE 1 ENDIF"],
+["1", "IF 0xeb ELSE 1 ENDIF"],
+["1", "IF 0xec ELSE 1 ENDIF"],
+["1", "IF 0xed ELSE 1 ENDIF"],
["1", "IF 0xee ELSE 1 ENDIF"],
+["1", "IF 0xef ELSE 1 ENDIF"],
+["1", "IF 0xf0 ELSE 1 ENDIF"],
+["1", "IF 0xf1 ELSE 1 ENDIF"],
+["1", "IF 0xf2 ELSE 1 ENDIF"],
+["1", "IF 0xf3 ELSE 1 ENDIF"],
+["1", "IF 0xf4 ELSE 1 ENDIF"],
+["1", "IF 0xf5 ELSE 1 ENDIF"],
+["1", "IF 0xf6 ELSE 1 ENDIF"],
+["1", "IF 0xf7 ELSE 1 ENDIF"],
+["1", "IF 0xf8 ELSE 1 ENDIF"],
+["1", "IF 0xf9 ELSE 1 ENDIF"],
+["1", "IF 0xfa ELSE 1 ENDIF"],
+["1", "IF 0xfb ELSE 1 ENDIF"],
+["1", "IF 0xfc ELSE 1 ENDIF"],
["1", "IF 0xfd ELSE 1 ENDIF"],
+["1", "IF 0xfe ELSE 1 ENDIF"],
["1", "IF 0xff ELSE 1 ENDIF"],
+["1 IF 1 ELSE", "0xff ENDIF", "invalid because scriptSig and scriptPubKey are processed separately"],
+
["NOP", "RIPEMD160"],
["NOP", "SHA1"],
["NOP", "SHA256"],
View
64 src/test/data/script_valid.json
@@ -188,10 +188,74 @@
["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_10' EQUAL"],
["0", "IF 0xba ELSE 1 ENDIF", "opcodes above NOP10 invalid if executed"],
+["0", "IF 0xbb ELSE 1 ENDIF"],
+["0", "IF 0xbc ELSE 1 ENDIF"],
+["0", "IF 0xbd ELSE 1 ENDIF"],
+["0", "IF 0xbe ELSE 1 ENDIF"],
+["0", "IF 0xbf ELSE 1 ENDIF"],
["0", "IF 0xc0 ELSE 1 ENDIF"],
+["0", "IF 0xc1 ELSE 1 ENDIF"],
+["0", "IF 0xc2 ELSE 1 ENDIF"],
+["0", "IF 0xc3 ELSE 1 ENDIF"],
+["0", "IF 0xc4 ELSE 1 ENDIF"],
+["0", "IF 0xc5 ELSE 1 ENDIF"],
+["0", "IF 0xc6 ELSE 1 ENDIF"],
+["0", "IF 0xc7 ELSE 1 ENDIF"],
+["0", "IF 0xc8 ELSE 1 ENDIF"],
+["0", "IF 0xc9 ELSE 1 ENDIF"],
+["0", "IF 0xca ELSE 1 ENDIF"],
+["0", "IF 0xcb ELSE 1 ENDIF"],
+["0", "IF 0xcc ELSE 1 ENDIF"],
+["0", "IF 0xcd ELSE 1 ENDIF"],
+["0", "IF 0xce ELSE 1 ENDIF"],
+["0", "IF 0xcf ELSE 1 ENDIF"],
+["0", "IF 0xd0 ELSE 1 ENDIF"],
["0", "IF 0xd1 ELSE 1 ENDIF"],
+["0", "IF 0xd2 ELSE 1 ENDIF"],
+["0", "IF 0xd3 ELSE 1 ENDIF"],
+["0", "IF 0xd4 ELSE 1 ENDIF"],
+["0", "IF 0xd5 ELSE 1 ENDIF"],
+["0", "IF 0xd6 ELSE 1 ENDIF"],
+["0", "IF 0xd7 ELSE 1 ENDIF"],
+["0", "IF 0xd8 ELSE 1 ENDIF"],
+["0", "IF 0xd9 ELSE 1 ENDIF"],
+["0", "IF 0xda ELSE 1 ENDIF"],
+["0", "IF 0xdb ELSE 1 ENDIF"],
+["0", "IF 0xdc ELSE 1 ENDIF"],
+["0", "IF 0xdd ELSE 1 ENDIF"],
+["0", "IF 0xde ELSE 1 ENDIF"],
+["0", "IF 0xdf ELSE 1 ENDIF"],
+["0", "IF 0xe0 ELSE 1 ENDIF"],
+["0", "IF 0xe1 ELSE 1 ENDIF"],
+["0", "IF 0xe2 ELSE 1 ENDIF"],
+["0", "IF 0xe3 ELSE 1 ENDIF"],
+["0", "IF 0xe4 ELSE 1 ENDIF"],
+["0", "IF 0xe5 ELSE 1 ENDIF"],
+["0", "IF 0xe6 ELSE 1 ENDIF"],
+["0", "IF 0xe7 ELSE 1 ENDIF"],
+["0", "IF 0xe8 ELSE 1 ENDIF"],
+["0", "IF 0xe9 ELSE 1 ENDIF"],
+["0", "IF 0xea ELSE 1 ENDIF"],
+["0", "IF 0xeb ELSE 1 ENDIF"],
+["0", "IF 0xec ELSE 1 ENDIF"],
+["0", "IF 0xed ELSE 1 ENDIF"],
["0", "IF 0xee ELSE 1 ENDIF"],
+["0", "IF 0xef ELSE 1 ENDIF"],
+["0", "IF 0xf0 ELSE 1 ENDIF"],
+["0", "IF 0xf1 ELSE 1 ENDIF"],
+["0", "IF 0xf2 ELSE 1 ENDIF"],
+["0", "IF 0xf3 ELSE 1 ENDIF"],
+["0", "IF 0xf4 ELSE 1 ENDIF"],
+["0", "IF 0xf5 ELSE 1 ENDIF"],
+["0", "IF 0xf6 ELSE 1 ENDIF"],
+["0", "IF 0xf7 ELSE 1 ENDIF"],
+["0", "IF 0xf8 ELSE 1 ENDIF"],
+["0", "IF 0xf9 ELSE 1 ENDIF"],
+["0", "IF 0xfa ELSE 1 ENDIF"],
+["0", "IF 0xfb ELSE 1 ENDIF"],
+["0", "IF 0xfc ELSE 1 ENDIF"],
["0", "IF 0xfd ELSE 1 ENDIF"],
+["0", "IF 0xfe ELSE 1 ENDIF"],
["0", "IF 0xff ELSE 1 ENDIF"],
["NOP",
Please sign in to comment.
Something went wrong with that request. Please try again.