Changeset View
Changeset View
Standalone View
Standalone View
src/test/data/script_tests.json
| Show First 20 Lines • Show All 925 Lines • ▼ Show 20 Lines | |||||
| ["0x05 0x01000f0080", "BIN2NUM -983041 EQUAL", "P2SH,STRICTENC", "OK", "Ensure significant zero bytes are retained"], | ["0x05 0x01000f0080", "BIN2NUM -983041 EQUAL", "P2SH,STRICTENC", "OK", "Ensure significant zero bytes are retained"], | ||||
| ["NOP", "SIZE 1", "P2SH,STRICTENC", "INVALID_STACK_OPERATION"], | ["NOP", "SIZE 1", "P2SH,STRICTENC", "INVALID_STACK_OPERATION"], | ||||
| ["Disabled opcodes"], | ["Disabled opcodes"], | ||||
| ["'abc'", "IF INVERT ELSE 1 ENDIF", "P2SH,STRICTENC", "DISABLED_OPCODE", "INVERT disabled"], | ["'abc'", "IF INVERT ELSE 1 ENDIF", "P2SH,STRICTENC", "DISABLED_OPCODE", "INVERT disabled"], | ||||
| ["'abc'", "IF INVERT ELSE 1 ENDIF", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "INVERT disabled"], | ["'abc'", "IF INVERT ELSE 1 ENDIF", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "INVERT disabled"], | ||||
| ["2 0 IF 2MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "2MUL disabled"], | ["2 0 IF 2MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "2MUL disabled"], | ||||
| ["2 0 IF 2MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "2MUL disabled"], | ["2 0 IF 2MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "2MUL enabled"], | ||||
| ["2 0 IF 2DIV ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "2DIV disabled"], | ["2 0 IF 2DIV ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "2DIV disabled"], | ||||
| ["2 0 IF 2DIV ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "2DIV disabled"], | ["2 0 IF 2DIV ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "2DIV enabled"], | ||||
| ["2 2 0 IF MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "MUL disabled"], | ["2 2 0 IF MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "MUL disabled"], | ||||
| ["2 2 0 IF MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "MUL disabled"], | ["2 2 0 IF MUL ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "MUL disabled"], | ||||
| ["2 2 0 IF LSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "LSHIFT disabled"], | ["2 2 0 IF LSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "LSHIFT disabled"], | ||||
| ["2 2 0 IF LSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "LSHIFT disabled"], | ["2 2 0 IF LSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "LSHIFT disabled"], | ||||
| ["2 2 0 IF RSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "RSHIFT disabled"], | ["2 2 0 IF RSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC", "DISABLED_OPCODE", "RSHIFT disabled"], | ||||
| ["2 2 0 IF RSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "RSHIFT disabled"], | ["2 2 0 IF RSHIFT ELSE 1 ENDIF", "NOP", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "RSHIFT disabled"], | ||||
| ["Bitwise opcodes"], | ["Bitwise opcodes"], | ||||
| ▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
| ["-2147483647 -123", "MOD -79 EQUAL", "P2SH,STRICTENC", "OK", "Check boundary condition"], | ["-2147483647 -123", "MOD -79 EQUAL", "P2SH,STRICTENC", "OK", "Check boundary condition"], | ||||
| ["-123 -2147483647", "MOD -123 EQUAL", "P2SH,STRICTENC", "OK", "Check boundary condition"], | ["-123 -2147483647", "MOD -123 EQUAL", "P2SH,STRICTENC", "OK", "Check boundary condition"], | ||||
| ["-2147483647 -2147483647", "MOD 0 EQUAL", "P2SH,STRICTENC", "OK", "Check boundary condition"], | ["-2147483647 -2147483647", "MOD 0 EQUAL", "P2SH,STRICTENC", "OK", "Check boundary condition"], | ||||
| ["2147483648 1", "MOD", "P2SH,STRICTENC", "UNKNOWN_ERROR", "We cannot do math on 5-byte integers"], | ["2147483648 1", "MOD", "P2SH,STRICTENC", "UNKNOWN_ERROR", "We cannot do math on 5-byte integers"], | ||||
| ["1 2147483648", "MOD", "P2SH,STRICTENC", "UNKNOWN_ERROR", "We cannot do math on 5-byte integers"], | ["1 2147483648", "MOD", "P2SH,STRICTENC", "UNKNOWN_ERROR", "We cannot do math on 5-byte integers"], | ||||
| ["-2147483648 1", "MOD", "P2SH,STRICTENC", "UNKNOWN_ERROR", "We cannot do math on 5-byte integers"], | ["-2147483648 1", "MOD", "P2SH,STRICTENC", "UNKNOWN_ERROR", "We cannot do math on 5-byte integers"], | ||||
| ["1 -2147483648", "MOD", "P2SH,STRICTENC", "UNKNOWN_ERROR", "We cannot do math on 5-byte integers"], | ["1 -2147483648", "MOD", "P2SH,STRICTENC", "UNKNOWN_ERROR", "We cannot do math on 5-byte integers"], | ||||
| ["2MUL"], | |||||
danconnolly: 2MUL and 2DIV tests moved up here to with the "arithmetic operators" group of tests. | |||||
| ["2", "2MUL 4 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | |||||
| ["", "2MUL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "INVALID_STACK_OPERATION", "2MUL, not enough parameters"], | |||||
| ["2", "2MUL 4 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "simple 2MUL test"], | |||||
| ["0", "2MUL 0 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "0*2=0"], | |||||
| ["0x0180", "2MUL 0 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "(-0)*2=0"], | |||||
| ["1", "2MUL 2 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "1*2=2"], | |||||
| ["-2", "2MUL -4 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "simple 2MUL negative test"], | |||||
| ["-1", "2MUL -2 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "-1*2=-2"], | |||||
| ["2147483647", "2MUL 4294967294 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "boundary condition"], | |||||
| ["2147483648", "2MUL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "UNKNOWN_ERROR", "2MUL, parameter too large"], | |||||
| ["-2147483647", "2MUL -4294967294 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "boundary condition"], | |||||
| ["-2147483648", "2MUL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "UNKNOWN_ERROR", "2MUL, parameter too large"], | |||||
| ["2DIV"], | |||||
| ["2", "2DIV 1 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | |||||
| ["", "2DIV", "P2SH,STRICTENC,MAGNETIC_OPCODES", "INVALID_STACK_OPERATION", "2DIV, not enough parameters"], | |||||
| ["2", "2DIV 1 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "simple 2DIV test"], | |||||
| ["0", "2DIV 0 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "0/2=0"], | |||||
| ["0x0180", "2DIV 0 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "(-0)/2=0"], | |||||
| ["-8", "2DIV -4 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "simple 2DIV negative test"], | |||||
| ["-2", "2DIV -1 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "-2/2=-1"], | |||||
| ["7", "2DIV 3 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "round towards zero"], | |||||
| ["-7", "2DIV -3 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "round towards zero"], | |||||
| ["2147483647", "2DIV 1073741823 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "boundary condition"], | |||||
| ["2147483648", "2DIV", "P2SH,STRICTENC,MAGNETIC_OPCODES", "UNKNOWN_ERROR", "2DIV, parameter too large"], | |||||
| ["-2147483647", "2DIV -1073741823 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "OK", "boundary condition"], | |||||
| ["-2147483648", "2DIV", "P2SH,STRICTENC,MAGNETIC_OPCODES", "UNKNOWN_ERROR", "2DIV, parameter too large"], | |||||
| ["EQUAL"], | ["EQUAL"], | ||||
| ["", "EQUAL NOT", "P2SH,STRICTENC", "INVALID_STACK_OPERATION", "EQUAL must error when there are no stack items"], | ["", "EQUAL NOT", "P2SH,STRICTENC", "INVALID_STACK_OPERATION", "EQUAL must error when there are no stack items"], | ||||
| ["0", "EQUAL NOT", "P2SH,STRICTENC", "INVALID_STACK_OPERATION", "EQUAL must error when there are not 2 stack items"], | ["0", "EQUAL NOT", "P2SH,STRICTENC", "INVALID_STACK_OPERATION", "EQUAL must error when there are not 2 stack items"], | ||||
| ["0 1","EQUAL", "P2SH,STRICTENC", "EVAL_FALSE"], | ["0 1","EQUAL", "P2SH,STRICTENC", "EVAL_FALSE"], | ||||
| ["1 1 ADD", "0 EQUAL", "P2SH,STRICTENC", "EVAL_FALSE"], | ["1 1 ADD", "0 EQUAL", "P2SH,STRICTENC", "EVAL_FALSE"], | ||||
| ["11 1 ADD 12 SUB", "11 EQUAL", "P2SH,STRICTENC", "EVAL_FALSE"], | ["11 1 ADD 12 SUB", "11 EQUAL", "P2SH,STRICTENC", "EVAL_FALSE"], | ||||
| ["2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "UNKNOWN_ERROR", "arithmetic operands must be in range [-2^31...2^31] "], | ["2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "UNKNOWN_ERROR", "arithmetic operands must be in range [-2^31...2^31] "], | ||||
| ["-2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "UNKNOWN_ERROR", "arithmetic operands must be in range [-2^31...2^31] "], | ["-2147483648 0 ADD", "NOP", "P2SH,STRICTENC", "UNKNOWN_ERROR", "arithmetic operands must be in range [-2^31...2^31] "], | ||||
| ["2147483647 DUP ADD", "4294967294 NUMEQUAL", "P2SH,STRICTENC", "UNKNOWN_ERROR", "NUMEQUAL must be in numeric range"], | ["2147483647 DUP ADD", "4294967294 NUMEQUAL", "P2SH,STRICTENC", "UNKNOWN_ERROR", "NUMEQUAL must be in numeric range"], | ||||
| ["'abcdef' NOT", "0 EQUAL", "P2SH,STRICTENC", "UNKNOWN_ERROR", "NOT is an arithmetic operand"], | ["'abcdef' NOT", "0 EQUAL", "P2SH,STRICTENC", "UNKNOWN_ERROR", "NOT is an arithmetic operand"], | ||||
| ["MUL"], | ["MUL"], | ||||
| ["2 DUP MUL", "4 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | ["2 DUP MUL", "4 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | ||||
| ["2 DUP MUL", "4 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "disabled"], | ["2 DUP MUL", "4 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "disabled"], | ||||
| ["2MUL"], | |||||
| ["2 2MUL", "4 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | |||||
| ["2 2MUL", "4 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "disabled"], | |||||
| ["2DIV"], | |||||
| ["2 2DIV", "1 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | |||||
| ["2 2DIV", "1 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "disabled"], | |||||
| ["LSHIFT"], | ["LSHIFT"], | ||||
| ["2 2 LSHIFT", "8 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | ["2 2 LSHIFT", "8 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | ||||
| ["2 2 LSHIFT", "8 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "disabled"], | ["2 2 LSHIFT", "8 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "disabled"], | ||||
| ["RSHIFT"], | ["RSHIFT"], | ||||
| ["2 1 RSHIFT", "1 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | ["2 1 RSHIFT", "1 EQUAL", "P2SH,STRICTENC", "DISABLED_OPCODE", "disabled"], | ||||
| ["2 1 RSHIFT", "1 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "disabled"], | ["2 1 RSHIFT", "1 EQUAL", "P2SH,STRICTENC,MAGNETIC_OPCODES", "DISABLED_OPCODE", "disabled"], | ||||
| ▲ Show 20 Lines • Show All 1,138 Lines • Show Last 20 Lines | |||||
2MUL and 2DIV tests moved up here to with the "arithmetic operators" group of tests.