Skip to content
This repository
Browse code

Add coverage for all invalid ops

0xba thru 0xff
  • Loading branch information...
commit 6131d1d9dfadc9e78e64574209a8014dcb4c8244 1 parent 0bd573d
Peter Todd petertodd authored
68 src/test/data/script_invalid.json
@@ -128,13 +128,79 @@
128 128 ["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_11' EQUAL"],
129 129
130 130 ["0x50","1", "opcode 0x50 is reserved"],
131   -["1", "IF 0xba ELSE 1 ENDIF", "opcodes above NOP10 invalid"],
  131 +["1", "IF 0xba ELSE 1 ENDIF", "opcodes above NOP10 invalid if executed"],
  132 +["1", "IF 0xbb ELSE 1 ENDIF"],
  133 +["1", "IF 0xbc ELSE 1 ENDIF"],
  134 +["1", "IF 0xbd ELSE 1 ENDIF"],
  135 +["1", "IF 0xbe ELSE 1 ENDIF"],
  136 +["1", "IF 0xbf ELSE 1 ENDIF"],
132 137 ["1", "IF 0xc0 ELSE 1 ENDIF"],
  138 +["1", "IF 0xc1 ELSE 1 ENDIF"],
  139 +["1", "IF 0xc2 ELSE 1 ENDIF"],
  140 +["1", "IF 0xc3 ELSE 1 ENDIF"],
  141 +["1", "IF 0xc4 ELSE 1 ENDIF"],
  142 +["1", "IF 0xc5 ELSE 1 ENDIF"],
  143 +["1", "IF 0xc6 ELSE 1 ENDIF"],
  144 +["1", "IF 0xc7 ELSE 1 ENDIF"],
  145 +["1", "IF 0xc8 ELSE 1 ENDIF"],
  146 +["1", "IF 0xc9 ELSE 1 ENDIF"],
  147 +["1", "IF 0xca ELSE 1 ENDIF"],
  148 +["1", "IF 0xcb ELSE 1 ENDIF"],
  149 +["1", "IF 0xcc ELSE 1 ENDIF"],
  150 +["1", "IF 0xcd ELSE 1 ENDIF"],
  151 +["1", "IF 0xce ELSE 1 ENDIF"],
  152 +["1", "IF 0xcf ELSE 1 ENDIF"],
  153 +["1", "IF 0xd0 ELSE 1 ENDIF"],
133 154 ["1", "IF 0xd1 ELSE 1 ENDIF"],
  155 +["1", "IF 0xd2 ELSE 1 ENDIF"],
  156 +["1", "IF 0xd3 ELSE 1 ENDIF"],
  157 +["1", "IF 0xd4 ELSE 1 ENDIF"],
  158 +["1", "IF 0xd5 ELSE 1 ENDIF"],
  159 +["1", "IF 0xd6 ELSE 1 ENDIF"],
  160 +["1", "IF 0xd7 ELSE 1 ENDIF"],
  161 +["1", "IF 0xd8 ELSE 1 ENDIF"],
  162 +["1", "IF 0xd9 ELSE 1 ENDIF"],
  163 +["1", "IF 0xda ELSE 1 ENDIF"],
  164 +["1", "IF 0xdb ELSE 1 ENDIF"],
  165 +["1", "IF 0xdc ELSE 1 ENDIF"],
  166 +["1", "IF 0xdd ELSE 1 ENDIF"],
  167 +["1", "IF 0xde ELSE 1 ENDIF"],
  168 +["1", "IF 0xdf ELSE 1 ENDIF"],
  169 +["1", "IF 0xe0 ELSE 1 ENDIF"],
  170 +["1", "IF 0xe1 ELSE 1 ENDIF"],
  171 +["1", "IF 0xe2 ELSE 1 ENDIF"],
  172 +["1", "IF 0xe3 ELSE 1 ENDIF"],
  173 +["1", "IF 0xe4 ELSE 1 ENDIF"],
  174 +["1", "IF 0xe5 ELSE 1 ENDIF"],
  175 +["1", "IF 0xe6 ELSE 1 ENDIF"],
  176 +["1", "IF 0xe7 ELSE 1 ENDIF"],
  177 +["1", "IF 0xe8 ELSE 1 ENDIF"],
  178 +["1", "IF 0xe9 ELSE 1 ENDIF"],
  179 +["1", "IF 0xea ELSE 1 ENDIF"],
  180 +["1", "IF 0xeb ELSE 1 ENDIF"],
  181 +["1", "IF 0xec ELSE 1 ENDIF"],
  182 +["1", "IF 0xed ELSE 1 ENDIF"],
134 183 ["1", "IF 0xee ELSE 1 ENDIF"],
  184 +["1", "IF 0xef ELSE 1 ENDIF"],
  185 +["1", "IF 0xf0 ELSE 1 ENDIF"],
  186 +["1", "IF 0xf1 ELSE 1 ENDIF"],
  187 +["1", "IF 0xf2 ELSE 1 ENDIF"],
  188 +["1", "IF 0xf3 ELSE 1 ENDIF"],
  189 +["1", "IF 0xf4 ELSE 1 ENDIF"],
  190 +["1", "IF 0xf5 ELSE 1 ENDIF"],
  191 +["1", "IF 0xf6 ELSE 1 ENDIF"],
  192 +["1", "IF 0xf7 ELSE 1 ENDIF"],
  193 +["1", "IF 0xf8 ELSE 1 ENDIF"],
  194 +["1", "IF 0xf9 ELSE 1 ENDIF"],
  195 +["1", "IF 0xfa ELSE 1 ENDIF"],
  196 +["1", "IF 0xfb ELSE 1 ENDIF"],
  197 +["1", "IF 0xfc ELSE 1 ENDIF"],
135 198 ["1", "IF 0xfd ELSE 1 ENDIF"],
  199 +["1", "IF 0xfe ELSE 1 ENDIF"],
136 200 ["1", "IF 0xff ELSE 1 ENDIF"],
137 201
  202 +["1 IF 1 ELSE", "0xff ENDIF", "invalid because scriptSig and scriptPubKey are processed separately"],
  203 +
138 204 ["NOP", "RIPEMD160"],
139 205 ["NOP", "SHA1"],
140 206 ["NOP", "SHA256"],
64 src/test/data/script_valid.json
@@ -188,10 +188,74 @@
188 188 ["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_10' EQUAL"],
189 189
190 190 ["0", "IF 0xba ELSE 1 ENDIF", "opcodes above NOP10 invalid if executed"],
  191 +["0", "IF 0xbb ELSE 1 ENDIF"],
  192 +["0", "IF 0xbc ELSE 1 ENDIF"],
  193 +["0", "IF 0xbd ELSE 1 ENDIF"],
  194 +["0", "IF 0xbe ELSE 1 ENDIF"],
  195 +["0", "IF 0xbf ELSE 1 ENDIF"],
191 196 ["0", "IF 0xc0 ELSE 1 ENDIF"],
  197 +["0", "IF 0xc1 ELSE 1 ENDIF"],
  198 +["0", "IF 0xc2 ELSE 1 ENDIF"],
  199 +["0", "IF 0xc3 ELSE 1 ENDIF"],
  200 +["0", "IF 0xc4 ELSE 1 ENDIF"],
  201 +["0", "IF 0xc5 ELSE 1 ENDIF"],
  202 +["0", "IF 0xc6 ELSE 1 ENDIF"],
  203 +["0", "IF 0xc7 ELSE 1 ENDIF"],
  204 +["0", "IF 0xc8 ELSE 1 ENDIF"],
  205 +["0", "IF 0xc9 ELSE 1 ENDIF"],
  206 +["0", "IF 0xca ELSE 1 ENDIF"],
  207 +["0", "IF 0xcb ELSE 1 ENDIF"],
  208 +["0", "IF 0xcc ELSE 1 ENDIF"],
  209 +["0", "IF 0xcd ELSE 1 ENDIF"],
  210 +["0", "IF 0xce ELSE 1 ENDIF"],
  211 +["0", "IF 0xcf ELSE 1 ENDIF"],
  212 +["0", "IF 0xd0 ELSE 1 ENDIF"],
192 213 ["0", "IF 0xd1 ELSE 1 ENDIF"],
  214 +["0", "IF 0xd2 ELSE 1 ENDIF"],
  215 +["0", "IF 0xd3 ELSE 1 ENDIF"],
  216 +["0", "IF 0xd4 ELSE 1 ENDIF"],
  217 +["0", "IF 0xd5 ELSE 1 ENDIF"],
  218 +["0", "IF 0xd6 ELSE 1 ENDIF"],
  219 +["0", "IF 0xd7 ELSE 1 ENDIF"],
  220 +["0", "IF 0xd8 ELSE 1 ENDIF"],
  221 +["0", "IF 0xd9 ELSE 1 ENDIF"],
  222 +["0", "IF 0xda ELSE 1 ENDIF"],
  223 +["0", "IF 0xdb ELSE 1 ENDIF"],
  224 +["0", "IF 0xdc ELSE 1 ENDIF"],
  225 +["0", "IF 0xdd ELSE 1 ENDIF"],
  226 +["0", "IF 0xde ELSE 1 ENDIF"],
  227 +["0", "IF 0xdf ELSE 1 ENDIF"],
  228 +["0", "IF 0xe0 ELSE 1 ENDIF"],
  229 +["0", "IF 0xe1 ELSE 1 ENDIF"],
  230 +["0", "IF 0xe2 ELSE 1 ENDIF"],
  231 +["0", "IF 0xe3 ELSE 1 ENDIF"],
  232 +["0", "IF 0xe4 ELSE 1 ENDIF"],
  233 +["0", "IF 0xe5 ELSE 1 ENDIF"],
  234 +["0", "IF 0xe6 ELSE 1 ENDIF"],
  235 +["0", "IF 0xe7 ELSE 1 ENDIF"],
  236 +["0", "IF 0xe8 ELSE 1 ENDIF"],
  237 +["0", "IF 0xe9 ELSE 1 ENDIF"],
  238 +["0", "IF 0xea ELSE 1 ENDIF"],
  239 +["0", "IF 0xeb ELSE 1 ENDIF"],
  240 +["0", "IF 0xec ELSE 1 ENDIF"],
  241 +["0", "IF 0xed ELSE 1 ENDIF"],
193 242 ["0", "IF 0xee ELSE 1 ENDIF"],
  243 +["0", "IF 0xef ELSE 1 ENDIF"],
  244 +["0", "IF 0xf0 ELSE 1 ENDIF"],
  245 +["0", "IF 0xf1 ELSE 1 ENDIF"],
  246 +["0", "IF 0xf2 ELSE 1 ENDIF"],
  247 +["0", "IF 0xf3 ELSE 1 ENDIF"],
  248 +["0", "IF 0xf4 ELSE 1 ENDIF"],
  249 +["0", "IF 0xf5 ELSE 1 ENDIF"],
  250 +["0", "IF 0xf6 ELSE 1 ENDIF"],
  251 +["0", "IF 0xf7 ELSE 1 ENDIF"],
  252 +["0", "IF 0xf8 ELSE 1 ENDIF"],
  253 +["0", "IF 0xf9 ELSE 1 ENDIF"],
  254 +["0", "IF 0xfa ELSE 1 ENDIF"],
  255 +["0", "IF 0xfb ELSE 1 ENDIF"],
  256 +["0", "IF 0xfc ELSE 1 ENDIF"],
194 257 ["0", "IF 0xfd ELSE 1 ENDIF"],
  258 +["0", "IF 0xfe ELSE 1 ENDIF"],
195 259 ["0", "IF 0xff ELSE 1 ENDIF"],
196 260
197 261 ["NOP",

0 comments on commit 6131d1d

Please sign in to comment.
Something went wrong with that request. Please try again.