diff --git a/txscript/data/script_tests.json b/txscript/data/script_tests.json index 6b84e165f1..21fee1f953 100644 --- a/txscript/data/script_tests.json +++ b/txscript/data/script_tests.json @@ -420,6 +420,7 @@ ["1", "IF VER ELSE 1 ENDIF", "NONE", "ERR_RESERVED_OPCODE", "VER non-functional"], ["IF test coverage"], +["NOP", "IF 1 ENDIF", "NONE", "ERR_INVALID_STACK_OPERATION", "IF requires an item on the stack and NOP must not be treated as one"], ["1", "DUP IF ENDIF", "NONE", "OK"], ["1", "IF 1 ENDIF", "NONE", "OK"], ["1", "DUP IF ELSE ENDIF", "NONE", "OK"], @@ -461,9 +462,10 @@ ["0 1", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "NONE", "ERR_EVAL_FALSE"], ["1", "IF 1", "NONE", "ERR_UNBALANCED_CONDITIONAL", "IF without ENDIF"], ["1 IF 1", "ENDIF", "NONE", "ERR_UNBALANCED_CONDITIONAL", "IFs don't carry over"], +["0", "IF 'b'{2049} ENDIF 1", "NONE", "ERR_PUSH_SIZE", ">2048 byte push in non-executed IF branch"], +["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"], -["NOP", "IF 1 ENDIF", "NONE", "ERR_INVALID_STACK_OPERATION", "IF requires an input"], ["Unevaluated non-minimal pushes are ignored"], ["0 IF 0x4c 0x00 ENDIF 1", "", "NONE", "OK", "non-minimal PUSHDATA1 ignored"], @@ -488,6 +490,8 @@ ["0 IF 0x01 0x10 ENDIF 1", "", "NONE", "OK", "OP_16 equiv"], ["NOTIF test coverage"], +["NOP", "NOTIF 1 ENDIF", "NONE", "ERR_INVALID_STACK_OPERATION", "NOTIF requires an item on the stack, the stack has no items"], +["NOP", "NOTIF 1 ENDIF", "NONE", "ERR_INVALID_STACK_OPERATION", "NOTIF requires an item on the stack and NOP must not be treated as one"], ["1 0", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "NONE", "OK"], ["1 1", "NOTIF IF 1 ELSE 0 ENDIF ENDIF", "NONE", "OK"], ["1 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "NONE", "OK"], @@ -505,7 +509,6 @@ ["1 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "NONE", "ERR_EVAL_FALSE"], ["0 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF", "NONE", "ERR_EVAL_FALSE"], ["0 NOTIF", "123", "NONE", "ERR_UNBALANCED_CONDITIONAL"], -["NOP", "NOTIF 1 ENDIF", "NONE", "ERR_INVALID_STACK_OPERATION", "NOTIF requires an input"], ["VERIF test coverage"], ["0", "IF ELSE 1 ELSE VERIF ENDIF", "NONE", "ERR_RESERVED_OPCODE", "VERIF illegal everywhere"], @@ -555,6 +558,279 @@ ["CHECKSEQUENCEVERIFY test coverage"], ["", "CHECKSEQUENCEVERIFY", "NONE", "ERR_EMPTY_STACK", "CHECKSEQUENCEVERIFY requires a transaction and a stack item"], +["STACK opcode tests"], + +["TOALTSTACK/FROMALTSTACK test coverage"], +["10 0 11 TOALTSTACK DROP FROMALTSTACK", "ADD 21 EQUAL", "NONE", "OK"], +["'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"], +["DATA_2 0x7a{2}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_2 0x7a{2} EQUAL", "NONE", "OK", "2-byte pushes must be able to round trip alt data stack"], +["DATA_3 0x7a{3}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_3 0x7a{3} EQUAL", "NONE", "OK", "3-byte pushes must be able to round trip alt data stack"], +["DATA_4 0x7a{4}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_4 0x7a{4} EQUAL", "NONE", "OK", "4-byte pushes must be able to round trip alt data stack"], +["DATA_5 0x7a{5}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_5 0x7a{5} EQUAL", "NONE", "OK", "5-byte pushes must be able to round trip alt data stack"], +["DATA_6 0x7a{6}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_6 0x7a{6} EQUAL", "NONE", "OK", "6-byte pushes must be able to round trip alt data stack"], +["DATA_7 0x7a{7}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_7 0x7a{7} EQUAL", "NONE", "OK", "7-byte pushes must be able to round trip alt data stack"], +["DATA_8 0x7a{8}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_8 0x7a{8} EQUAL", "NONE", "OK", "8-byte pushes must be able to round trip alt data stack"], +["DATA_9 0x7a{9}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_9 0x7a{9} EQUAL", "NONE", "OK", "9-byte pushes must be able to round trip alt data stack"], +["DATA_10 0x7a{10}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_10 0x7a{10} EQUAL", "NONE", "OK", "10-byte pushes must be able to round trip alt data stack"], +["DATA_11 0x7a{11}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_11 0x7a{11} EQUAL", "NONE", "OK", "11-byte pushes must be able to round trip alt data stack"], +["DATA_12 0x7a{12}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_12 0x7a{12} EQUAL", "NONE", "OK", "12-byte pushes must be able to round trip alt data stack"], +["DATA_13 0x7a{13}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_13 0x7a{13} EQUAL", "NONE", "OK", "13-byte pushes must be able to round trip alt data stack"], +["DATA_14 0x7a{14}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_14 0x7a{14} EQUAL", "NONE", "OK", "14-byte pushes must be able to round trip alt data stack"], +["DATA_15 0x7a{15}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_15 0x7a{15} EQUAL", "NONE", "OK", "15-byte pushes must be able to round trip alt data stack"], +["DATA_16 0x7a{16}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_16 0x7a{16} EQUAL", "NONE", "OK", "16-byte pushes must be able to round trip alt data stack"], +["DATA_17 0x7a{17}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_17 0x7a{17} EQUAL", "NONE", "OK", "17-byte pushes must be able to round trip alt data stack"], +["DATA_18 0x7a{18}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_18 0x7a{18} EQUAL", "NONE", "OK", "18-byte pushes must be able to round trip alt data stack"], +["DATA_19 0x7a{19}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_19 0x7a{19} EQUAL", "NONE", "OK", "19-byte pushes must be able to round trip alt data stack"], +["DATA_20 0x7a{20}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_20 0x7a{20} EQUAL", "NONE", "OK", "20-byte pushes must be able to round trip alt data stack"], +["DATA_21 0x7a{21}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_21 0x7a{21} EQUAL", "NONE", "OK", "21-byte pushes must be able to round trip alt data stack"], +["DATA_22 0x7a{22}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_22 0x7a{22} EQUAL", "NONE", "OK", "22-byte pushes must be able to round trip alt data stack"], +["DATA_23 0x7a{23}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_23 0x7a{23} EQUAL", "NONE", "OK", "23-byte pushes must be able to round trip alt data stack"], +["DATA_24 0x7a{24}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_24 0x7a{24} EQUAL", "NONE", "OK", "24-byte pushes must be able to round trip alt data stack"], +["DATA_25 0x7a{25}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_25 0x7a{25} EQUAL", "NONE", "OK", "25-byte pushes must be able to round trip alt data stack"], +["DATA_26 0x7a{26}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_26 0x7a{26} EQUAL", "NONE", "OK", "26-byte pushes must be able to round trip alt data stack"], +["DATA_27 0x7a{27}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_27 0x7a{27} EQUAL", "NONE", "OK", "27-byte pushes must be able to round trip alt data stack"], +["DATA_28 0x7a{28}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_28 0x7a{28} EQUAL", "NONE", "OK", "28-byte pushes must be able to round trip alt data stack"], +["DATA_29 0x7a{29}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_29 0x7a{29} EQUAL", "NONE", "OK", "29-byte pushes must be able to round trip alt data stack"], +["DATA_30 0x7a{30}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_30 0x7a{30} EQUAL", "NONE", "OK", "30-byte pushes must be able to round trip alt data stack"], +["DATA_31 0x7a{31}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_31 0x7a{31} EQUAL", "NONE", "OK", "31-byte pushes must be able to round trip alt data stack"], +["DATA_32 0x7a{32}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_32 0x7a{32} EQUAL", "NONE", "OK", "32-byte pushes must be able to round trip alt data stack"], +["DATA_33 0x7a{33}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_33 0x7a{33} EQUAL", "NONE", "OK", "33-byte pushes must be able to round trip alt data stack"], +["DATA_34 0x7a{34}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_34 0x7a{34} EQUAL", "NONE", "OK", "34-byte pushes must be able to round trip alt data stack"], +["DATA_35 0x7a{35}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_35 0x7a{35} EQUAL", "NONE", "OK", "35-byte pushes must be able to round trip alt data stack"], +["DATA_36 0x7a{36}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_36 0x7a{36} EQUAL", "NONE", "OK", "36-byte pushes must be able to round trip alt data stack"], +["DATA_37 0x7a{37}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_37 0x7a{37} EQUAL", "NONE", "OK", "37-byte pushes must be able to round trip alt data stack"], +["DATA_38 0x7a{38}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_38 0x7a{38} EQUAL", "NONE", "OK", "38-byte pushes must be able to round trip alt data stack"], +["DATA_39 0x7a{39}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_39 0x7a{39} EQUAL", "NONE", "OK", "39-byte pushes must be able to round trip alt data stack"], +["DATA_40 0x7a{40}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_40 0x7a{40} EQUAL", "NONE", "OK", "40-byte pushes must be able to round trip alt data stack"], +["DATA_41 0x7a{41}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_41 0x7a{41} EQUAL", "NONE", "OK", "41-byte pushes must be able to round trip alt data stack"], +["DATA_42 0x7a{42}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_42 0x7a{42} EQUAL", "NONE", "OK", "42-byte pushes must be able to round trip alt data stack"], +["DATA_43 0x7a{43}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_43 0x7a{43} EQUAL", "NONE", "OK", "43-byte pushes must be able to round trip alt data stack"], +["DATA_44 0x7a{44}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_44 0x7a{44} EQUAL", "NONE", "OK", "44-byte pushes must be able to round trip alt data stack"], +["DATA_45 0x7a{45}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_45 0x7a{45} EQUAL", "NONE", "OK", "45-byte pushes must be able to round trip alt data stack"], +["DATA_46 0x7a{46}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_46 0x7a{46} EQUAL", "NONE", "OK", "46-byte pushes must be able to round trip alt data stack"], +["DATA_47 0x7a{47}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_47 0x7a{47} EQUAL", "NONE", "OK", "47-byte pushes must be able to round trip alt data stack"], +["DATA_48 0x7a{48}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_48 0x7a{48} EQUAL", "NONE", "OK", "48-byte pushes must be able to round trip alt data stack"], +["DATA_49 0x7a{49}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_49 0x7a{49} EQUAL", "NONE", "OK", "49-byte pushes must be able to round trip alt data stack"], +["DATA_50 0x7a{50}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_50 0x7a{50} EQUAL", "NONE", "OK", "50-byte pushes must be able to round trip alt data stack"], +["DATA_51 0x7a{51}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_51 0x7a{51} EQUAL", "NONE", "OK", "51-byte pushes must be able to round trip alt data stack"], +["DATA_52 0x7a{52}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_52 0x7a{52} EQUAL", "NONE", "OK", "52-byte pushes must be able to round trip alt data stack"], +["DATA_53 0x7a{53}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_53 0x7a{53} EQUAL", "NONE", "OK", "53-byte pushes must be able to round trip alt data stack"], +["DATA_54 0x7a{54}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_54 0x7a{54} EQUAL", "NONE", "OK", "54-byte pushes must be able to round trip alt data stack"], +["DATA_55 0x7a{55}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_55 0x7a{55} EQUAL", "NONE", "OK", "55-byte pushes must be able to round trip alt data stack"], +["DATA_56 0x7a{56}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_56 0x7a{56} EQUAL", "NONE", "OK", "56-byte pushes must be able to round trip alt data stack"], +["DATA_57 0x7a{57}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_57 0x7a{57} EQUAL", "NONE", "OK", "57-byte pushes must be able to round trip alt data stack"], +["DATA_58 0x7a{58}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_58 0x7a{58} EQUAL", "NONE", "OK", "58-byte pushes must be able to round trip alt data stack"], +["DATA_59 0x7a{59}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_59 0x7a{59} EQUAL", "NONE", "OK", "59-byte pushes must be able to round trip alt data stack"], +["DATA_60 0x7a{60}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_60 0x7a{60} EQUAL", "NONE", "OK", "60-byte pushes must be able to round trip alt data stack"], +["DATA_61 0x7a{61}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_61 0x7a{61} EQUAL", "NONE", "OK", "61-byte pushes must be able to round trip alt data stack"], +["DATA_62 0x7a{62}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_62 0x7a{62} EQUAL", "NONE", "OK", "62-byte pushes must be able to round trip alt data stack"], +["DATA_63 0x7a{63}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_63 0x7a{63} EQUAL", "NONE", "OK", "63-byte pushes must be able to round trip alt data stack"], +["DATA_64 0x7a{64}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_64 0x7a{64} EQUAL", "NONE", "OK", "64-byte pushes must be able to round trip alt data stack"], +["DATA_65 0x7a{65}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_65 0x7a{65} EQUAL", "NONE", "OK", "65-byte pushes must be able to round trip alt data stack"], +["DATA_66 0x7a{66}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_66 0x7a{66} EQUAL", "NONE", "OK", "66-byte pushes must be able to round trip alt data stack"], +["DATA_67 0x7a{67}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_67 0x7a{67} EQUAL", "NONE", "OK", "67-byte pushes must be able to round trip alt data stack"], +["DATA_68 0x7a{68}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_68 0x7a{68} EQUAL", "NONE", "OK", "68-byte pushes must be able to round trip alt data stack"], +["DATA_69 0x7a{69}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_69 0x7a{69} EQUAL", "NONE", "OK", "69-byte pushes must be able to round trip alt data stack"], +["DATA_70 0x7a{70}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_70 0x7a{70} EQUAL", "NONE", "OK", "70-byte pushes must be able to round trip alt data stack"], +["DATA_71 0x7a{71}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_71 0x7a{71} EQUAL", "NONE", "OK", "71-byte pushes must be able to round trip alt data stack"], +["DATA_72 0x7a{72}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_72 0x7a{72} EQUAL", "NONE", "OK", "72-byte pushes must be able to round trip alt data stack"], +["DATA_73 0x7a{73}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_73 0x7a{73} EQUAL", "NONE", "OK", "73-byte pushes must be able to round trip alt data stack"], +["DATA_74 0x7a{74}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_74 0x7a{74} EQUAL", "NONE", "OK", "74-byte pushes must be able to round trip alt data stack"], +["DATA_75 0x7a{75}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK DATA_75 0x7a{75} EQUAL", "NONE", "OK", "75-byte pushes must be able to round trip alt data stack"], +["PUSHDATA1 0x4c 0x7a{76}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK PUSHDATA1 0x4c 0x7a{76} EQUAL", "NONE", "OK", "76-byte pushes must be able to round trip alt data stack"], +["PUSHDATA2 0x0001 0x7a{256}", "TOALTSTACK DEPTH 0 EQUALVERIFY FROMALTSTACK PUSHDATA2 0x0001 0x7a{256} EQUAL", "NONE", "OK", "-byte pushes must be able to round trip alt data stack"], + +["DATA_2 0x7a{2} TOALTSTACK", "FROMALTSTACK DATA_2 0x7a{2} EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION", "ALTSTACK is cleared in between sigScript execution and pkScript execution"], + +["2DROP test coverage"], +["", "2DROP DEPTH 0 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION", "2DROP requires two items on the stack, the stack has no items"], +["1", "2DROP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2DROP requires two items on the stack, the stack has no items"], +["DATA_7 0x7a{7}", "2DROP DEPTH 0 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION", "2DROP requires two items on the stack, the stack has one item"], +["0 0", "2DROP 1", "NONE", "OK"], +["2 4", "2DROP 1", "NONE", "OK", "2DROP should remove the top two stack items"], +["DATA_15 0x7a{15} DATA_7 0x7a{7}", "2DROP DEPTH 0 EQUAL", "NONE", "OK", "2DROP must remove top two stack items"], + +["2DUP test coverage"], +["", "2DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2DUP requires two items on the stack, the stack has no items"], +["NOP", "2DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2DUP requires two items on the stack and NOP must not be treated as one"], +["1", "2DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2DUP requires two items on the stack, the stack has one item"], +["DATA_7 0x7a{7}", "2DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2DUP requires two stack items, the stack has one item"], +["0 1", "2DUP", "NONE", "OK"], +["2 4", "2DUP ADD 6 EQUALVERIFY 2DROP 1", "NONE", "OK", "2DUP must duplicate top two stack items to the top of the stack"], +["2 3", "2DUP {3} 10 EQUAL", "NONE", "OK", "2DUP must duplicate top two stack items"], +["13 14", "2DUP ROT EQUALVERIFY EQUAL", "NONE", "OK"], + +["3DUP test coverage"], +["NOP", "3DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "3DUP requires three items on the stack and NOP must not be treated as one"], +["", "3DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "3DUP requires three items on the stack, the stack has no items"], +["1", "3DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "3DUP requires three items on the stack, the stack has one item"], +["1 2", "3DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "3DUP requires three items on the stack, the stack has two items"], +["DATA_7 0x7a{7} DATA_15 0x7a{15}", "3DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "3DUP requires three items on the stack, the stack has two items"], +["1 1", "3DUP", "NONE", "ERR_INVALID_STACK_OPERATION", "3DUP requires three items on the stack, the stack has two items"], +["0 0 1", "3DUP", "NONE", "OK"], +["1 2 3", "3DUP {5} 18 EQUAL 1", "NONE", "OK", "3DUP must duplicate top three stack items"], +["-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"], + +["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"], +["", "2OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2OVER requires four items on the stack, the stack has no items"], +["1", "2OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2OVER requires four items on the stack, the stack has one item"], +["1 2", "2OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2OVER requires four items on the stack, the stack has two items"], +["1 1 1", "2OVER", "NONE", "ERR_INVALID_STACK_OPERATION", "2OVER requires four items on the stack, the stack has three items"], +["1", "2 3 2OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2OVER requires four items on the stack, the stack has three items"], +["0 1 0 0", "2OVER", "NONE", "OK"], +["0 1 0 0", "2OVER DEPTH 6 EQUALVERIFY 2DROP 2DROP 0 EQUAL 0 EQUAL 1", "NONE", "OK", "2OVER must copy the top two stack items to the back of the stack"], +["1 2 3 5", "2OVER ADD ADD 8 EQUALVERIFY ADD ADD 6 EQUAL", "NONE", "OK"], + +["2ROT test coverage"], +["NOP", "2ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2ROT requires six items on the stack and NOP must not be treated as one"], +["", "2ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2ROT requires six items on the stack, the stack has no items"], +["1", "2ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2ROT requires six items on the stack, the stack has one item"], +["0 1", "2ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2ROT requires six items on the stack, the stack has two items"], +["0 1 0", "2ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2ROT requires six items on the stack, the stack has three items"], +["0 1 0 0", "2ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2ROT requires six items on the stack, the stack has four items"], +["1 1 1 1 1", "2ROT", "NONE", "ERR_INVALID_STACK_OPERATION", "2ROT requires six items on the stack, the stack has five items"], +["0 1 0 0 0 0", "2ROT", "NONE", "OK"], +["25 24 23 22 21 20", "2ROT 24 EQUAL <2DROP>{3} 1", "CLEANSTACK", "OK"], +["25 24 23 22 21 20", "2ROT DROP 25 EQUAL <2DROP>{2} DROP 1", "CLEANSTACK", "OK"], +["25 24 23 22 21 20", "2ROT 2DROP 20 EQUAL <2DROP>{2} 1", "CLEANSTACK", "OK"], +["25 24 23 22 21 20", "2ROT 2DROP DROP 21 EQUAL 2DROP DROP 1", "CLEANSTACK", "OK"], +["25 24 23 22 21 20", "2ROT 2DROP 2DROP 22 EQUAL 2DROP 1", "CLEANSTACK", "OK"], +["25 24 23 22 21 20", "2ROT 2DROP 2DROP DROP 23 EQUAL DROP 1", "CLEANSTACK", "OK"], +["25 24 23 22 21 20", "2ROT 2ROT 22 EQUAL <2DROP>{3} 1", "CLEANSTACK", "OK"], +["25 24 23 22 21 20", "2ROT 2ROT 2ROT 20 EQUAL <2DROP>{3} 1", "CLEANSTACK", "OK"], +["DATA_2 0x7a{2} DATA_3 0x6c{3} DATA_5 0xff{5} DATA_6 0x1c{6} DATA_10 0xcc{10} DATA_12 0xfc{12}", "2ROT DATA_3 0x6c{3} EQUAL <2DROP>{3} 1", "CLEANSTACK", "OK"], +["DATA_2 0x7a{2} DATA_3 0x6c{3} DATA_5 0xff{5} DATA_6 0x1c{6} DATA_10 0xcc{10} DATA_12 0xfc{12}", "2ROT DROP DATA_2 0x7a{2} EQUAL <2DROP>{2} DROP 1", "CLEANSTACK", "OK"], +["DATA_2 0x7a{2} DATA_3 0x6c{3} DATA_5 0xff{5} DATA_6 0x1c{6} DATA_10 0xcc{10} DATA_12 0xfc{12}", "2ROT 2ROT 2ROT DATA_12 0xfc{12} EQUAL <2DROP>{3} 1", "CLEANSTACK", "OK"], + +["2SWAP test coverage"], +["", "2SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2SWAP requires four items on the stack, the stack has no items"], +["NOP", "2SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2SWAP requires four items on the stack and NOP must not be treated as one"], +["1", "2 3 2SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2SWAP requires four items on the stack, the stack has one item"], +["0 1", "2SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "2SWAP requires four items on the stack, the stack has has two items"], +["1 1 1", "2SWAP", "NONE", "ERR_INVALID_STACK_OPERATION", "2SWAP requires four items on the stack, the stack has three items"], +["0 1 0 0", "2SWAP <2DROP>{2} 1", "CLEANSTACK", "OK"], +["1 3 5 7", "2SWAP ADD 4 EQUALVERIFY ADD 12 EQUAL", "CLEANSTACK", "OK"], + +["IFDUP test coverage"], +["NOP", "IFDUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "IFDUP requires an item on the stack and NOP must not be treated as one"], +["", "IFDUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "IFDUP requires an item on the stack, the stack has no items"], +["1", "IFDUP", "NONE", "OK"], +["0 IFDUP", "DEPTH 1 EQUALVERIFY 0 EQUAL", "CLEANSTACK", "OK"], +["1 IFDUP", "DEPTH 2 EQUALVERIFY 1 EQUALVERIFY 1 EQUAL", "CLEANSTACK", "OK"], +["0x05 0x0100000000 IFDUP", "DEPTH 2 EQUALVERIFY 0x05 0x0100000000 EQUAL DROP", "CLEANSTACK", "OK", "IFDUP dups non ints"], +["IFDUP", "DEPTH 0 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION"], + +["DEPTH test coverage"], +["NOP", "DEPTH 1", "NONE", "OK"], +["NOP", "DEPTH 0 EQUAL", "NONE", "OK"], +["DATA_5 0x7a{5}", "DEPTH 1 EQUALVERIFY DROP 1", "CLEANSTACK", "OK"], +["", "DEPTH 0 EQUAL", "CLEANSTACK", "OK"], + +["DROP test coverage"], +["NOP", "DROP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "DROP requires an item on the stack and NOP must not be treated as one"], +["", "DROP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "DROP requires an item on the stack, the stack has no items"], +["DROP", "DEPTH 0 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION", "DROP requires an item on the stack, the stack has no items"], +["0", "DROP 1", "CLEANSTACK", "OK"], +["0 DROP", "DEPTH 0 EQUAL", "CLEANSTACK", "OK"], +["0", "DUP 1 ADD 1 EQUALVERIFY 0 EQUAL", "CLEANSTACK", "OK"], + +["DUP test coverage"], +["", "DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "DUP requires an item on the stack, the stack has no items"], +["NOP", "DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "DUP requires an item on the stack and NOP must not be treated as one"], +["DUP", "DEPTH 0 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION", "DUP requires an item on the stack, the stack has no items"], +["1", "DUP 2DROP 1", "NONE", "OK"], +["1", "DUP ADD 2 EQUALVERIFY 1", "NONE", "OK", "DUP must duplicate the top stack item"], +["1", "DUP 1 ADD 2 EQUALVERIFY 0 EQUAL", "NONE", "ERR_EVAL_FALSE"], + +["NIP test coverage"], +["NOP", "NIP", "NONE", "ERR_INVALID_STACK_OPERATION", "NIP requires at least two items on the stack and NOP must not be treated as one"], +["", "NIP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "NIP requires at least two items on the stack, the stack has no items"], +["1", "NIP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "NIP requires at least two items on the stack, the stack is one item"], +["0 1", "NIP DROP 1", "CLEANSTACK", "OK"], +["1 2", "NIP 2 EQUAL DROP 1", "CLEANSTACK", "OK", "NIP must remove the item before the top item on the stack"], +["NOP", "1 0 NIP", "NONE", "ERR_EVAL_FALSE"], + +["OVER test coverage"], +["NOP", "OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION", "OVER requires at least two items on the stack and NOP must not be treated as one"], +["", "OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION", "OVER requires a least two items on the stack, the stack has no items"], +["1", "OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION", "OVER requires at least two items on the stack, the stack has one item"], +["0 1", "OVER DEPTH 3 EQUALVERIFY", "NONE", "ERR_EVAL_FALSE"], +["1 0", "OVER 2DROP DROP 1", "CLEANSTACK", "OK"], +["1 0", "OVER ADD ADD 2 EQUALVERIFY 1", "CLEANSTACK", "OK", "OVER must duplicate the item before the top item on the data stack."], +["1 0", "OVER DEPTH 3 EQUALVERIFY 2DROP DROP 1", "CLEANSTACK", "OK"], + +["PICK test coverage"], +["NOP", "0 PICK", "NONE", "ERR_INVALID_STACK_OPERATION", "PICK requires two items on the stack and NOP must not be treated as one"], +["", "PICK 1", "NONE", "ERR_INVALID_STACK_OPERATION", "PICK requires two items on the stack, the stack has no items"], +["0", "PICK 1", "NONE", "ERR_INVALID_STACK_OPERATION", "PICK requires two items on the stack, the stack has one item"], +["1 1", "PICK ADD 2 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION", "PICK index of 1 is out of bounds"], +["19 20 21", "PICK 19 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION", "PICK index of 21 is out of bounds"], +["1", "-1 PICK", "NONE", "ERR_INVALID_STACK_OPERATION", "PICK index of -1 is out of bounds"], +["1 0 0 0 3", "PICK <2DROP>{2} DROP 1", "CLEANSTACK", "OK"], +["1 0", "PICK 2DROP 1", "CLEANSTACK", "OK"], +["1 0", "PICK DEPTH 2 EQUALVERIFY 2DROP 1", "CLEANSTACK", "OK", "the stack depth should equal the initial since PICK pops the index"], +["1 0", "PICK ADD 2 EQUALVERIFY 1", "CLEANSTACK", "OK", "PICK must duplicate the stack item at the supplied index to the top of the stack."], +["19 20 21", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], +["19 20 21", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], +["19 20 21", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], +["22 21 20", "0 PICK 20 EQUALVERIFY 2DROP DROP 1", "CLEANSTACK", "OK"], +["22 21 20", "1 PICK 21 EQUALVERIFY 2DROP DROP 1", "CLEANSTACK", "OK"], +["22 21 20", "2 PICK 22 EQUALVERIFY 2DROP DROP 1", "CLEANSTACK", "OK"], +["1 1 1 3", "PICK", "NONE", "ERR_INVALID_STACK_OPERATION"], + +["ROLL test coverage"], +["", "ROLL 1", "NONE", "ERR_INVALID_STACK_OPERATION", "ROLL requires two items on the stack, the stack has no items"], +["NOP", "0 ROLL", "NONE", "ERR_INVALID_STACK_OPERATION", "ROLL requires two items on the stack and NOP must not be treated as one"], +["1", "ROLL 1", "NONE", "ERR_INVALID_STACK_OPERATION", "ROLL requires two items on the stack, the stack has one item"], +["1", "-1 ROLL", "NONE", "ERR_INVALID_STACK_OPERATION", "ROLL index is out of bounds"], +["1 0", "ROLL DROP 1", "CLEANSTACK", "OK"], +["1 0 0 0 3", "ROLL 2DROP DROP 1", "NONE", "OK"], +["1 1 1 3", "ROLL", "NONE", "ERR_INVALID_STACK_OPERATION"], +["0", "ROLL 1", "NONE", "ERR_INVALID_STACK_OPERATION"], +["19 20 21", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], +["19 20 21", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], +["19 20 21", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], +["22 21 20", "0 ROLL 20 EQUALVERIFY 2DROP 1", "CLEANSTACK", "OK"], +["22 21 20", "1 ROLL 21 EQUALVERIFY 2DROP 1", "CLEANSTACK", "OK"], +["22 21 20", "2 ROLL 22 EQUALVERIFY 2DROP 1", "CLEANSTACK", "OK"], + +["ROT test coverage"], +["NOP", "ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "ROT requires three items on the stack and NOP must not be treated as one"], +["", "ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "ROT requires three items on the stack, the stack has no items"], +["NOP", "1 ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "ROT requires three items on the stack, the stack has one item disregarding NOP"], +["1", "ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "ROT requires three items on the stack, the stack has one item"], +["1 0", "ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "ROT requires three items on the stack, the stack has two items"], +["NOP", "1 2 ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION", "ROT requires three items on the stack, the stack has two items disregarding NOP"], +["1 0 0", "ROT 2DROP DROP 1", "CLEANSTACK", "OK"], +["22 21 20", "ROT 22 EQUALVERIFY 2DROP 1", "CLEANSTACK", "OK"], +["22 21 20", "ROT DROP 20 EQUALVERIFY DROP 1", "CLEANSTACK", "OK"], +["22 21 20", "ROT DROP DROP 21 EQUALVERIFY 1", "CLEANSTACK", "OK"], +["22 21 20", "ROT ROT 21 EQUALVERIFY 2DROP 1", "CLEANSTACK", "OK"], +["22 21 20", "ROT ROT ROT 20 EQUALVERIFY 2DROP 1", "CLEANSTACK", "OK"], +["NOP", "0 1 2 ROT", "NONE", "ERR_EVAL_FALSE"], + +["SWAP test coverage"], +["NOP", "SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "SWAP requires two items on the stack and NOP must not be treated as one"], +["", "SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "SWAP requires two items on the stack, the stack has no items"], +["1", "SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION", "SWAP requires two items on the stack, the stack has one item"], +["1 0", "SWAP 2DROP 1", "CLEANSTACK", "OK"], +["1 0", "SWAP 1 EQUALVERIFY DROP 1", "CLEANSTACK", "OK"], +["0 1", "SWAP 1 EQUALVERIFY", "NONE", "ERR_EQUAL_VERIFY"], + +["TUCK test coverage"], +["NOP", "TUCK 1", "NONE", "ERR_INVALID_STACK_OPERATION", "TUCK requires two items on the stack and NOP must not be treated as one"], +["", "TUCK 1", "NONE", "ERR_INVALID_STACK_OPERATION", "TUCK requires two items on the stack, the stack has no items"], +["1", "TUCK 1", "NONE", "ERR_INVALID_STACK_OPERATION", "TUCK requires two items on the stack, the stack has one item"], +["0 1", "TUCK 2DROP DROP 1", "CLEANSTACK", "OK"], +["0 1", "TUCK ADD ADD 2 EQUALVERIFY 1", "CLEANSTACK", "OK"], +["0 1", "TUCK DEPTH 3 EQUALVERIFY 2DROP DROP 1", "CLEANSTACK", "OK"], +["1 0", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP", "NONE", "ERR_EVAL_FALSE"], + ["CAT related test coverage"], ["'a' 'b'", "CAT 'ab' EQUAL", "NONE", "OK", "CAT concatenates two input args"], ["'a' 2147483648", "CAT 0x06 0x610000008000 EQUAL", "NONE", "OK", "CAT must treat arguments as bytes as opposed to numeric"], @@ -851,42 +1127,6 @@ ["0", "IF VER ELSE 1 ENDIF", "NONE", "OK", "VER non-functional (ok if not executed)"], ["0", "IF RESERVED ELSE 1 ENDIF", "NONE", "OK", "RESERVED ok in un-executed IF"], - -["10 0 11 TOALTSTACK DROP FROMALTSTACK", "ADD 21 EQUAL", "NONE", "OK"], -["'gavin_was_here' TOALTSTACK 11 FROMALTSTACK", "'gavin_was_here' EQUALVERIFY 11 EQUAL", "NONE", "OK"], - -["0 IFDUP", "DEPTH 1 EQUALVERIFY 0 EQUAL", "NONE", "OK"], -["1 IFDUP", "DEPTH 2 EQUALVERIFY 1 EQUALVERIFY 1 EQUAL", "NONE", "OK"], -["0x05 0x0100000000 IFDUP", "DEPTH 2 EQUALVERIFY 0x05 0x0100000000 EQUAL", "NONE", "OK", "IFDUP dups non ints"], -["0 DROP", "DEPTH 0 EQUAL", "NONE", "OK"], -["0", "DUP 1 ADD 1 EQUALVERIFY 0 EQUAL", "NONE", "OK"], -["0 1", "NIP", "NONE", "OK"], -["1 0", "OVER DEPTH 3 EQUALVERIFY", "NONE", "OK"], -["22 21 20", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL", "NONE", "OK"], -["22 21 20", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL", "NONE", "OK"], -["22 21 20", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL", "NONE", "OK"], -["22 21 20", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "OK"], -["22 21 20", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "OK"], -["22 21 20", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "OK"], -["22 21 20", "ROT 22 EQUAL", "NONE", "OK"], -["22 21 20", "ROT DROP 20 EQUAL", "NONE", "OK"], -["22 21 20", "ROT DROP DROP 21 EQUAL", "NONE", "OK"], -["22 21 20", "ROT ROT 21 EQUAL", "NONE", "OK"], -["22 21 20", "ROT ROT ROT 20 EQUAL", "NONE", "OK"], -["25 24 23 22 21 20", "2ROT 24 EQUAL", "NONE", "OK"], -["25 24 23 22 21 20", "2ROT DROP 25 EQUAL", "NONE", "OK"], -["25 24 23 22 21 20", "2ROT 2DROP 20 EQUAL", "NONE", "OK"], -["25 24 23 22 21 20", "2ROT 2DROP DROP 21 EQUAL", "NONE", "OK"], -["25 24 23 22 21 20", "2ROT 2DROP 2DROP 22 EQUAL", "NONE", "OK"], -["25 24 23 22 21 20", "2ROT 2DROP 2DROP DROP 23 EQUAL", "NONE", "OK"], -["25 24 23 22 21 20", "2ROT 2ROT 22 EQUAL", "NONE", "OK"], -["25 24 23 22 21 20", "2ROT 2ROT 2ROT 20 EQUAL", "NONE", "OK"], -["1 0", "SWAP 1 EQUALVERIFY 0 EQUAL", "NONE", "OK"], -["0 1", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP", "NONE", "OK"], -["13 14", "2DUP ROT EQUALVERIFY EQUAL", "NONE", "OK"], -["-1 0 1 2", "3DUP DEPTH 7 EQUALVERIFY ADD ADD 3 EQUALVERIFY 2DROP 0 EQUALVERIFY", "NONE", "OK"], -["1 2 3 5", "2OVER ADD ADD 8 EQUALVERIFY ADD ADD 6 EQUAL", "NONE", "OK"], -["1 3 5 7", "2SWAP ADD 4 EQUALVERIFY ADD 12 EQUAL", "NONE", "OK"], ["0", "SIZE 0 EQUAL", "NONE", "OK"], ["1", "SIZE 1 EQUAL", "NONE", "OK"], ["127", "SIZE 1 EQUAL", "NONE", "OK"], @@ -913,8 +1153,8 @@ ["-549755813888", "SIZE 6 EQUAL", "NONE", "OK"], ["-9223372036854775807", "SIZE 8 EQUAL", "NONE", "OK"], ["'abcdefghijklmnopqrstuvwxyz'", "SIZE 26 EQUAL", "NONE", "OK"], - ["42", "SIZE 1 EQUALVERIFY 42 EQUAL", "NONE", "OK", "SIZE does not consume argument"], +["NOP", "SIZE 1", "NONE", "ERR_INVALID_STACK_OPERATION"], ["2 -2 ADD", "0 EQUAL", "NONE", "OK"], ["2147483647 -2147483647 ADD", "0 EQUAL", "NONE", "OK"], @@ -1132,28 +1372,6 @@ ["0x03 0x100080", "0x04 0x10000080 NUMEQUAL", "NONE", "ERR_MINIMAL_DATA"], ["0x03 0x100000", "0x04 0x10000000 NUMEQUAL", "NONE", "ERR_MINIMAL_DATA"], -["0", "TOALTSTACK 1", "NONE", "OK"], -["1", "TOALTSTACK FROMALTSTACK", "NONE", "OK"], -["0 0", "2DROP 1", "NONE", "OK"], -["0 1", "2DUP", "NONE", "OK"], -["0 0 1", "3DUP", "NONE", "OK"], -["0 1 0 0", "2OVER", "NONE", "OK"], -["0 1 0 0 0 0", "2ROT", "NONE", "OK"], -["0 1 0 0", "2SWAP", "NONE", "OK"], -["1", "IFDUP", "NONE", "OK"], -["NOP", "DEPTH 1", "NONE", "OK"], -["0", "DROP 1", "NONE", "OK"], -["1", "DUP", "NONE", "OK"], -["0 1", "NIP", "NONE", "OK"], -["1 0", "OVER", "NONE", "OK"], -["1 0 0 0 3", "PICK", "NONE", "OK"], -["1 0", "PICK", "NONE", "OK"], -["1 0 0 0 3", "ROLL", "NONE", "OK"], -["1 0", "ROLL", "NONE", "OK"], -["1 0 0", "ROT", "NONE", "OK"], -["1 0", "SWAP", "NONE", "OK"], -["0 1", "TUCK", "NONE", "OK"], - ["1", "SIZE", "NONE", "OK"], ["0 0", "EQUAL", "NONE", "OK"], @@ -2101,52 +2319,6 @@ ["", "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"], - -["1 TOALTSTACK", "FROMALTSTACK 1", "NONE", "ERR_INVALID_ALTSTACK_OPERATION", "alt stack not shared between sig/pubkey"], - -["IFDUP", "DEPTH 0 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION"], -["DROP", "DEPTH 0 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION"], -["DUP", "DEPTH 0 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "DUP 1 ADD 2 EQUALVERIFY 0 EQUAL", "NONE", "ERR_EVAL_FALSE"], -["NOP", "NIP", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "1 NIP", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "1 0 NIP", "NONE", "ERR_EVAL_FALSE"], -["NOP", "OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "OVER", "NONE", "ERR_INVALID_STACK_OPERATION"], -["0 1", "OVER DEPTH 3 EQUALVERIFY", "NONE", "ERR_EVAL_FALSE"], -["19 20 21", "PICK 19 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "0 PICK", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "-1 PICK", "NONE", "ERR_INVALID_STACK_OPERATION"], -["19 20 21", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], -["19 20 21", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], -["19 20 21", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], -["NOP", "0 ROLL", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "-1 ROLL", "NONE", "ERR_INVALID_STACK_OPERATION"], -["19 20 21", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], -["19 20 21", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], -["19 20 21", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL", "NONE", "ERR_EQUAL_VERIFY"], -["NOP", "ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "1 ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "1 2 ROT 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "0 1 2 ROT", "NONE", "ERR_EVAL_FALSE"], -["NOP", "SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["0 1", "SWAP 1 EQUALVERIFY", "NONE", "ERR_EQUAL_VERIFY"], -["NOP", "TUCK 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "TUCK 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1 0", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP", "NONE", "ERR_EVAL_FALSE"], -["NOP", "2DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "2DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "3DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "3DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1 2", "3DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "2OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "2 3 2OVER 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "2SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "2 3 2SWAP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], - -["NOP", "SIZE 1", "NONE", "ERR_INVALID_STACK_OPERATION"], - ["", "EQUAL NOT", "NONE", "ERR_INVALID_STACK_OPERATION", "EQUAL must error when there are no stack items"], ["0", "EQUAL NOT", "NONE", "ERR_INVALID_STACK_OPERATION", "EQUAL must error when there are not 2 stack items"], ["0 1","EQUAL", "NONE", "ERR_EVAL_FALSE"], @@ -2263,11 +2435,7 @@ ["NOP", "HASH256", "NONE", "ERR_INVALID_STACK_OPERATION"], ["NOP", "'b'{2049}", "NONE", "ERR_PUSH_SIZE", ">2048 byte push"], -["0", "IF 'b'{2049} ENDIF 1", "NONE", "ERR_PUSH_SIZE", ">2048 byte push in non-executed IF branch"], ["1", "{256}", "NONE", "ERR_OP_COUNT", ">255 opcodes executed"], -["0", "IF {256} ENDIF 1", "NONE", "ERR_OP_COUNT", ">255 opcodes including non-executed IF branch"], -["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"], ["NOP", "0 'a'{2048} <'b'{2048}>{6} 'b'{2024}", "NONE", "ERR_SCRIPT_SIZE", "16385-byte scriptPubKey"], ["NOP1","NOP10", "NONE", "ERR_EMPTY_STACK"], @@ -2281,30 +2449,6 @@ ["2147483648 1", "BOOLOR 1", "NONE", "ERR_OUT_OF_RANGE", "We cannot do BOOLOR on 5-byte integers (but we can still do IF etc)"], ["2147483648 1", "BOOLAND 1", "NONE", "ERR_OUT_OF_RANGE", "We cannot do BOOLAND on 5-byte integers"], -["NOP", "TOALTSTACK 1", "NONE", "ERR_INVALID_STACK_OPERATION", "TOALTSTACK requires an input"], - -["1", "FROMALTSTACK", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "2DROP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "2DUP", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1 1", "3DUP", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1 1 1", "2OVER", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1 1 1 1 1", "2ROT", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1 1 1", "2SWAP", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "IFDUP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "DROP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["NOP", "DUP 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "NIP", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "OVER", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1 1 1 3", "PICK", "NONE", "ERR_INVALID_STACK_OPERATION"], -["0", "PICK 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1 1 1 3", "ROLL", "NONE", "ERR_INVALID_STACK_OPERATION"], -["0", "ROLL 1", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1 1", "ROT", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "SWAP", "NONE", "ERR_INVALID_STACK_OPERATION"], -["1", "TUCK", "NONE", "ERR_INVALID_STACK_OPERATION"], - -["NOP", "SIZE 1", "NONE", "ERR_INVALID_STACK_OPERATION"], - ["1", "EQUAL 1", "NONE", "ERR_INVALID_STACK_OPERATION"], ["1", "EQUALVERIFY 1", "NONE", "ERR_INVALID_STACK_OPERATION"],