aboutsummaryrefslogtreecommitdiff
path: root/src/test/data/script_valid.json
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/data/script_valid.json')
-rw-r--r--src/test/data/script_valid.json114
1 files changed, 107 insertions, 7 deletions
diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json
index f59d8b7284..6b527a8b49 100644
--- a/src/test/data/script_valid.json
+++ b/src/test/data/script_valid.json
@@ -1,17 +1,91 @@
[
-["0x4c0107","7 EQUAL", "0x4c is OP_PUSHDATA1"],
-["0x4d010008","8 EQUAL", "0x4d is OP_PUSHDATA2"],
-["0x4e0100000009","9 EQUAL", "0x4e is OP_PUSHDATA4"],
+["0x01 0x0b", "11 EQUAL", "push 1 byte"],
+["0x02 0x417a", "'Az' EQUAL"],
+["0x4b 0x417a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a",
+ "'Azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' EQUAL", "push 75 bytes"],
+
+["0x4c 0x01 0x07","7 EQUAL", "0x4c is OP_PUSHDATA1"],
+["0x4d 0x0100 0x08","8 EQUAL", "0x4d is OP_PUSHDATA2"],
+["0x4e 0x01000000 0x09","9 EQUAL", "0x4e is OP_PUSHDATA4"],
+
+["0x4c 0x00","0 EQUAL"],
+["0x4d 0x0000","0 EQUAL"],
+["0x4e 0x00000000","0 EQUAL"],
+["0x4f 1000 ADD","999 EQUAL"],
+["0", "IF 0x50 ENDIF 1", "0x50 is reserved (ok if not executed)"],
+["0x51", "0x5f ADD 0x60 EQUAL", "0x51 through 0x60 push 1 through 16 onto stack"],
+["1","NOP"],
+["0", "IF VER ELSE 1 ENDIF", "VER non-functional (ok if not executed)"],
+["0", "IF RESERVED1 RESERVED2 ELSE 1 ENDIF", "RESERVED ok in un-executed IF"],
+
+["1", "DUP IF ENDIF"],
+["1", "IF 1 ENDIF"],
+["1", "DUP IF ELSE ENDIF"],
+["1", "IF 1 ELSE ENDIF"],
+["0", "IF ELSE 1 ENDIF"],
+
+["1 1", "IF IF 1 ELSE 0 ENDIF ENDIF"],
+["1 0", "IF IF 1 ELSE 0 ENDIF ENDIF"],
+["1 1", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
+["0 0", "IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
+
+["1 0", "NOTIF IF 1 ELSE 0 ENDIF ENDIF"],
+["1 1", "NOTIF IF 1 ELSE 0 ENDIF ENDIF"],
+["1 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
+["0 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
+
+["1 1", "VERIFY"],
+
+["10 0 11 TOALTSTACK DROP FROMALTSTACK", "ADD 21 EQUAL"],
+["'gavin_was_here' TOALTSTACK 11 FROMALTSTACK", "'gavin_was_here' EQUALVERIFY 11 EQUAL"],
+
+["0 IFDUP", "DEPTH 1 EQUALVERIFY 0 EQUAL"],
+["1 IFDUP", "DEPTH 2 EQUALVERIFY 1 EQUALVERIFY 1 EQUAL"],
+["0 DROP", "DEPTH 0 EQUAL"],
+["0", "DUP 1 ADD 1 EQUALVERIFY 0 EQUAL"],
+["0 1", "NIP"],
+["1 0", "OVER DEPTH 3 EQUALVERIFY"],
+["22 21 20", "0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL"],
+["22 21 20", "1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL"],
+["22 21 20", "2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL"],
+["22 21 20", "0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL"],
+["22 21 20", "1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL"],
+["22 21 20", "2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL"],
+["22 21 20", "ROT 22 EQUAL"],
+["22 21 20", "ROT ROT 21 EQUAL"],
+["22 21 20", "ROT ROT ROT 20 EQUAL"],
+["1 0", "SWAP 1 EQUALVERIFY 0 EQUAL"],
+["0 1", "TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP"],
+["13 14", "2DUP ROT EQUALVERIFY EQUAL"],
+["-1 0 1 2", "3DUP DEPTH 7 EQUALVERIFY ADD ADD 3 EQUALVERIFY 2DROP 0 EQUALVERIFY"],
+["1 2 3 5", "2OVER ADD ADD 8 EQUALVERIFY ADD ADD 6 EQUAL"],
+["1 3 5 7", "2SWAP ADD 4 EQUALVERIFY ADD 12 EQUAL"],
+["0", "SIZE 0 EQUAL"],
+["1", "SIZE 1 EQUAL"],
+["127", "SIZE 1 EQUAL"],
+["128", "SIZE 2 EQUAL"],
+["32767", "SIZE 2 EQUAL"],
+["32768", "SIZE 3 EQUAL"],
+["8388607", "SIZE 3 EQUAL"],
+["8388608", "SIZE 4 EQUAL"],
+["2147483647", "SIZE 4 EQUAL"],
+["2147483648", "SIZE 5 EQUAL"],
+["-1", "SIZE 1 EQUAL"],
+["-127", "SIZE 1 EQUAL"],
+["-128", "SIZE 2 EQUAL"],
+["-32767", "SIZE 2 EQUAL"],
+["-32768", "SIZE 3 EQUAL"],
+["-8388607", "SIZE 3 EQUAL"],
+["-8388608", "SIZE 4 EQUAL"],
+["-2147483647", "SIZE 4 EQUAL"],
+["-2147483648", "SIZE 5 EQUAL"],
+["'abcdefghijklmnopqrstuvwxyz'", "SIZE 26 EQUAL"],
-["0x4c00","0 EQUAL"],
-["0x4d0000","0 EQUAL"],
-["0x4e00000000","0 EQUAL"],
["2 -2 ADD", "0 EQUAL"],
["2147483647 -2147483647 ADD", "0 EQUAL"],
["-1 -1 ADD", "-2 EQUAL"],
-["1","NOP"],
["0 0","EQUAL"],
["1 1 ADD", "2 EQUAL"],
["1 1ADD", "2 EQUAL"],
@@ -81,8 +155,34 @@
["2147483647 DUP ADD", "4294967294 EQUAL", ">32 bit EQUAL is valid"],
["2147483647 NEGATE DUP ADD", "-4294967294 EQUAL"],
+["''", "RIPEMD160 0x14 0x9c1185a5c5e9fc54612808977ee8f548b2258d31 EQUAL"],
+["'a'", "RIPEMD160 0x14 0x0bdc9d2d256b3ee9daae347be6f4dc835a467ffe EQUAL"],
+["'abcdefghijklmnopqrstuvwxyz'", "RIPEMD160 0x14 0xf71c27109c692c1b56bbdceb5b9d2865b3708dbc EQUAL"],
+["''", "SHA1 0x14 0xda39a3ee5e6b4b0d3255bfef95601890afd80709 EQUAL"],
+["'a'", "SHA1 0x14 0x86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 EQUAL"],
+["'abcdefghijklmnopqrstuvwxyz'", "SHA1 0x14 0x32d10c7b8cf96570ca04ce37f2a19d84240d3a89 EQUAL"],
+["''", "SHA256 0x20 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 EQUAL"],
+["'a'", "SHA256 0x20 0xca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb EQUAL"],
+["'abcdefghijklmnopqrstuvwxyz'", "SHA256 0x20 0x71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73 EQUAL"],
+["''", "DUP HASH160 SWAP SHA256 RIPEMD160 EQUAL"],
+["''", "DUP HASH256 SWAP SHA256 SHA256 EQUAL"],
+["''", "NOP HASH160 0x14 0xb472a266d0bd89c13706a4132ccfb16f7c3b9fcb EQUAL"],
+["'a'", "HASH160 NOP 0x14 0x994355199e516ff76c4fa4aab39337b9d84cf12b EQUAL"],
+["'abcdefghijklmnopqrstuvwxyz'", "HASH160 0x4c 0x14 0xc286a1af0947f58d1ad787385b1c2c4a976f9e71 EQUAL"],
+["''", "HASH256 0x20 0x5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456 EQUAL"],
+["'a'", "HASH256 0x20 0xbf5d3affb73efd2ec6c36ad3112dd933efed63c4e1cbffcfa88e2759c144f2d8 EQUAL"],
+["'abcdefghijklmnopqrstuvwxyz'", "HASH256 0x4c 0x20 0xca139bc10c2f660da42666f72e89a225936fc60f193c161124a672050c434671 EQUAL"],
+
+
["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 1 EQUAL"],
["'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 0xc0 ELSE 1 ENDIF"],
+["0", "IF 0xd1 ELSE 1 ENDIF"],
+["0", "IF 0xee ELSE 1 ENDIF"],
+["0", "IF 0xfd ELSE 1 ENDIF"],
+["0", "IF 0xff ELSE 1 ENDIF"],
+
["NOP","1"]
]