Bitcoin ABC 0.34.2
P2P Digital Currency
test_iguana.py
Go to the documentation of this file.
1# Copyright (c) 2024 The Bitcoin developers
2# Distributed under the MIT software license, see the accompanying
3# file COPYING or http://www.opensource.org/licenses/mit-license.php.
4"""Test the Iguana Script debugger."""
5
6import os
7import subprocess
8
9from test_framework.hash import hash160
10from test_framework.key import ECKey
11from test_framework.messages import COutPoint, CTransaction, CTxIn
12from test_framework.script import (
13 OP_1,
14 OP_2DUP,
15 OP_ADD,
16 OP_CHECKSIG,
17 OP_CHECKSIGVERIFY,
18 OP_DROP,
19 OP_DUP,
20 OP_EQUAL,
21 OP_HASH160,
22 OP_IF,
23 OP_NOP,
24 OP_NOT,
25 OP_TOALTSTACK,
26 CScript,
27)
28from test_framework.signature_hash import (
29 SIGHASH_ALL,
30 SIGHASH_FORKID,
31 SignatureHashForkId,
32)
33
34
35def iguana(*args, expected_stderr="", expected_returncode=None):
36 if expected_returncode is None:
37 expected_returncode = 255 if expected_stderr else 0
38
39 command = [os.environ["IGUANA_BIN"], *args]
40 if emulator := os.environ.get("EMULATOR", None):
41 command.insert(0, emulator)
42
43 child = subprocess.Popen(
44 command,
45 stdout=subprocess.PIPE,
46 stderr=subprocess.PIPE,
47 )
48 actual_stdout, actual_stderr = child.communicate()
49 assert actual_stderr.decode() == expected_stderr
50 assert child.returncode == expected_returncode
51 return actual_stdout.decode()
52
53
55 assert iguana("-version").startswith(
56 f"Iguana v{os.environ['CMAKE_PROJECT_VERSION']}"
57 )
58
59
61 assert iguana("-?").startswith("Usage: iguana")
62
63
65 iguana(
66 "-invalidarg",
67 expected_stderr="Error parsing command line arguments: Invalid parameter -invalidarg\n",
68 )
69
70
72 iguana(
73 "-format=doesntexist",
74 expected_stderr="Unsupported output format doesntexist\n",
75 )
76
77
79 iguana(
80 "-tx=010203",
81 "-scriptpubkey=51",
82 "-value=1",
83 expected_stderr="Error deserializing transaction\n",
84 )
85
86
88 tx = CTransaction()
89 iguana(
90 "-tx=" + tx.serialize().hex(),
91 "-inputindex=0",
92 "-scriptpubkey=",
93 "-value=0",
94 expected_stderr="Transaction doesn't have input index 0\n",
95 )
96
97
99 tx = CTransaction()
100 tx.vin = [CTxIn(COutPoint(), CScript([b"\x31", OP_DUP]))]
101
102 def run(fmt, expected_stderr):
103 return iguana(
104 "-tx=" + tx.serialize().hex(),
105 "-inputindex=0",
106 "-scriptpubkey=",
107 "-value=0",
108 f"-format={fmt}",
109 expected_stderr=expected_stderr,
110 expected_returncode=255,
111 )
112
113 assert (
114 run(
115 "human",
116 expected_stderr="scriptSig failed execution: Only push operators allowed in signatures\n",
117 )
118 == """\
119======= scriptSig =======
120 Stack (0 items): (empty stack)
121OP 0: 0x01 31
122 Stack (1 item):
123 0: 31
124OP 1: OP_DUP
125"""
126 )
127 assert (
128 run("csv", "")
129 == """\
130scriptName,index,opcode,stack 0,
131scriptSig,0,0x31,"31",
132scriptSig,1,OP_DUP,
133scriptSig failed execution: Only push operators allowed in signatures
134"""
135 )
136
137
139 tx = CTransaction()
140 tx.vin = [CTxIn(COutPoint(), CScript([b"\x31"]))]
141
142 def run(fmt):
143 return iguana(
144 "-tx=" + tx.serialize().hex(),
145 "-inputindex=0",
146 "-scriptpubkey=",
147 "-value=0",
148 f"-format={fmt}",
149 )
150
151 assert (
152 run("human")
153 == """\
154======= scriptSig =======
155 Stack (0 items): (empty stack)
156OP 0: 0x01 31
157======= scriptPubKey =======
158 Stack (1 item):
159 0: 31
160Script executed without errors
161"""
162 )
163 assert (
164 run("csv")
165 == """\
166scriptName,index,opcode,stack 0,
167scriptSig,0,0x31,"31",
168#sigChecks,0
169Script executed without errors
170"""
171 )
172
173
175 tx = CTransaction()
176 tx.vin = [CTxIn(COutPoint(), CScript(b"\x01"))]
177
178 def run(fmt, expected_stderr):
179 return iguana(
180 "-tx=" + tx.serialize().hex(),
181 "-inputindex=0",
182 "-scriptpubkey=",
183 "-value=0",
184 f"-format={fmt}",
185 expected_stderr=expected_stderr,
186 expected_returncode=255,
187 )
188
189 assert (
190 run(
191 "human",
192 expected_stderr="scriptSig failed execution: Invalidly encoded opcode\n",
193 )
194 == """\
195======= scriptSig =======
196 Stack (0 items): (empty stack)
197"""
198 )
199 assert (
200 run("csv", "")
201 == """\
202scriptName,index,opcode,
203scriptSig failed execution: Invalidly encoded opcode
204"""
205 )
206
207
209 tx = CTransaction()
210 tx.vin = [CTxIn(COutPoint(), CScript([b"\x31", b"\x32"]))]
211 script_pub_key = CScript([OP_ADD, b"\x63", OP_EQUAL])
212
213 def run(fmt):
214 return iguana(
215 "-tx=" + tx.serialize().hex(),
216 "-inputindex=0",
217 "-scriptpubkey=" + script_pub_key.hex(),
218 "-value=0",
219 f"-format={fmt}",
220 )
221
222 assert (
223 run("human")
224 == """\
225======= scriptSig =======
226 Stack (0 items): (empty stack)
227OP 0: 0x01 31
228 Stack (1 item):
229 0: 31
230OP 1: 0x01 32
231======= scriptPubKey =======
232 Stack (2 items):
233 0: 31
234 1: 32
235OP 0: OP_ADD
236 Stack (1 item):
237 0: 63
238OP 1: 0x01 63
239 Stack (2 items):
240 0: 63
241 1: 63
242OP 2: OP_EQUAL
243 Stack (1 item):
244 0: 01
245Script executed without errors
246"""
247 )
248 assert (
249 run("csv")
250 == """\
251scriptName,index,opcode,stack 0,stack 1,
252scriptSig,0,0x31,"31",
253scriptSig,1,0x32,"31","32",
254scriptPubKey,0,OP_ADD,"63",
255scriptPubKey,1,0x63,"63","63",
256scriptPubKey,2,OP_EQUAL,"01",
257#sigChecks,0
258Script executed without errors
259"""
260 )
261
262
264 tx = CTransaction()
265 tx.vin = [CTxIn(COutPoint(), CScript([b"\x31"]))]
266 script_pub_key = CScript([OP_EQUAL])
267 stdout = iguana(
268 "-tx=" + tx.serialize().hex(),
269 "-inputindex=0",
270 "-scriptpubkey=" + script_pub_key.hex(),
271 "-value=0",
272 expected_stderr="scriptPubKey failed execution: Operation not valid with the current stack size\n",
273 )
274 assert (
275 stdout
276 == """\
277======= scriptSig =======
278 Stack (0 items): (empty stack)
279OP 0: 0x01 31
280======= scriptPubKey =======
281 Stack (1 item):
282 0: 31
283OP 0: OP_EQUAL
284"""
285 )
286
287
289 tx = CTransaction()
290 tx.vin = [CTxIn(COutPoint(), CScript())]
291 script_pub_key = CScript([OP_1, OP_IF, OP_1])
292 stdout = iguana(
293 "-tx=" + tx.serialize().hex(),
294 "-inputindex=0",
295 "-scriptpubkey=" + script_pub_key.hex(),
296 "-value=0",
297 expected_stderr="scriptPubKey failed execution: Invalid OP_IF construction\n",
298 )
299 assert (
300 stdout
301 == """\
302======= scriptSig =======
303 Stack (0 items): (empty stack)
304======= scriptPubKey =======
305 Stack (0 items): (empty stack)
306OP 0: OP_1
307 Stack (1 item):
308 0: 01
309OP 1: OP_IF
310 Stack (0 items): (empty stack)
311OP 2: OP_1
312"""
313 )
314
315
317 tx = CTransaction()
318 tx.vin = [CTxIn(COutPoint(), CScript())]
319 script_pub_key = CScript([OP_NOP] * 10001)
320 stdout = iguana(
321 "-tx=" + tx.serialize().hex(),
322 "-inputindex=0",
323 "-scriptpubkey=" + script_pub_key.hex(),
324 "-value=0",
325 expected_stderr="scriptPubKey failed execution: Script is too big\n",
326 )
327 assert (
328 stdout
329 == """\
330======= scriptSig =======
331 Stack (0 items): (empty stack)
332======= scriptPubKey =======
333 Stack (0 items): (empty stack)
334"""
335 )
336
337
339 tx = CTransaction()
340 tx.vin = [CTxIn(COutPoint(), CScript([b"\x31"]))]
341 script_pub_key = CScript([OP_DROP])
342 stdout = iguana(
343 "-tx=" + tx.serialize().hex(),
344 "-inputindex=0",
345 "-scriptpubkey=" + script_pub_key.hex(),
346 "-value=0",
347 expected_stderr="scriptPubKey failed execution: Script evaluated without error but finished with a false/empty top stack element\n",
348 )
349 assert (
350 stdout
351 == """\
352======= scriptSig =======
353 Stack (0 items): (empty stack)
354OP 0: 0x01 31
355======= scriptPubKey =======
356 Stack (1 item):
357 0: 31
358OP 0: OP_DROP
359"""
360 )
361
362
364 tx = CTransaction()
365 tx.vin = [CTxIn(COutPoint(), CScript([b"\x31"]))]
366 script_pub_key = CScript([OP_NOT])
367 stdout = iguana(
368 "-tx=" + tx.serialize().hex(),
369 "-inputindex=0",
370 "-scriptpubkey=" + script_pub_key.hex(),
371 "-value=0",
372 expected_stderr="scriptPubKey failed execution: Script evaluated without error but finished with a false/empty top stack element\n",
373 )
374 assert (
375 stdout
376 == """\
377======= scriptSig =======
378 Stack (0 items): (empty stack)
379OP 0: 0x01 31
380======= scriptPubKey =======
381 Stack (1 item):
382 0: 31
383OP 0: OP_NOT
384"""
385 )
386
387
389 tx = CTransaction()
390 script_pub_key = CScript([1])
391 tx.vin = [CTxIn(COutPoint(), CScript([0]))]
392 stdout = iguana(
393 "-tx=" + tx.serialize().hex(),
394 "-inputindex=0",
395 "-scriptpubkey=" + script_pub_key.hex(),
396 "-value=0",
397 expected_stderr="scriptPubKey failed execution: Stack size must be exactly one after execution\n",
398 )
399 assert (
400 stdout
401 == """\
402======= scriptSig =======
403 Stack (0 items): (empty stack)
404OP 0: OP_0
405======= scriptPubKey =======
406 Stack (1 item):
407 0: ""
408OP 0: OP_1
409 Stack (2 items):
410 0: ""
411 1: 01
412"""
413 )
414
415
417 redeem_script = CScript([OP_TOALTSTACK, b"\x63", OP_EQUAL])
418 tx = CTransaction()
419 tx.vin = [CTxIn(COutPoint(), CScript([b"\x63", b"alt!", bytes(redeem_script)]))]
420 script_hash = hash160(redeem_script)
421 script_pub_key = CScript([OP_HASH160, script_hash, OP_EQUAL])
422
423 def run(fmt):
424 return iguana(
425 "-tx=" + tx.serialize().hex(),
426 "-inputindex=0",
427 "-scriptpubkey=" + script_pub_key.hex(),
428 "-value=0",
429 f"-format={fmt}",
430 )
431
432 assert (
433 run("human")
434 == f"""\
435======= scriptSig =======
436 Stack (0 items): (empty stack)
437OP 0: 0x01 63
438 Stack (1 item):
439 0: 63
440OP 1: 0x04 {b"alt!".hex()}
441 Stack (2 items):
442 0: 63
443 1: {b"alt!".hex()}
444OP 2: 0x04 {redeem_script.hex()}
445======= scriptPubKey =======
446 Stack (3 items):
447 0: 63
448 1: {b"alt!".hex()}
449 2: {redeem_script.hex()}
450OP 0: OP_HASH160
451 Stack (3 items):
452 0: 63
453 1: {b"alt!".hex()}
454 2: {script_hash.hex()}
455OP 1: 0x14 {script_hash.hex()}
456 Stack (4 items):
457 0: 63
458 1: {b"alt!".hex()}
459 2: {script_hash.hex()}
460 3: {script_hash.hex()}
461OP 2: OP_EQUAL
462 Stack (3 items):
463 0: 63
464 1: {b"alt!".hex()}
465 2: 01
466======= redeemScript =======
467 Stack (2 items):
468 0: 63
469 1: {b"alt!".hex()}
470OP 0: OP_TOALTSTACK
471 Stack (1 item):
472 0: 63
473 Altstack (1 item):
474 0: {b"alt!".hex()}
475OP 1: 0x01 63
476 Stack (2 items):
477 0: 63
478 1: 63
479 Altstack (1 item):
480 0: {b"alt!".hex()}
481OP 2: OP_EQUAL
482 Stack (1 item):
483 0: 01
484 Altstack (1 item):
485 0: {b"alt!".hex()}
486Script executed without errors
487"""
488 )
489 assert (
490 run("csv")
491 == f"""\
492scriptName,index,opcode,stack 0,stack 1,stack 2,stack 3,altstack 0,
493scriptSig,0,0x63,"63",
494scriptSig,1,0x{b"alt!".hex()},"63","{b"alt!".hex()}",
495scriptSig,2,0x{redeem_script.hex()},"63","{b"alt!".hex()}","{redeem_script.hex()}",
496scriptPubKey,0,OP_HASH160,"63","{b"alt!".hex()}","{script_hash.hex()}",
497scriptPubKey,1,0x{script_hash.hex()},"63","{b"alt!".hex()}","{script_hash.hex()}","{script_hash.hex()}",
498scriptPubKey,2,OP_EQUAL,"63","{b"alt!".hex()}","01",
499redeemScript,0,OP_TOALTSTACK,"63",,,,"{b"alt!".hex()}",
500redeemScript,1,0x63,"63","63",,,"{b"alt!".hex()}",
501redeemScript,2,OP_EQUAL,"01",,,,"{b"alt!".hex()}",
502#sigChecks,0
503Script executed without errors
504"""
505 )
506
507
509 redeem_script = CScript([OP_CHECKSIG])
510 tx = CTransaction()
511 tx.vin = [CTxIn(COutPoint(), CScript([b"wrong", b"sig", bytes(redeem_script)]))]
512 script_pub_key = CScript([OP_HASH160, hash160(redeem_script), OP_EQUAL])
513 stdout = iguana(
514 "-tx=" + tx.serialize().hex(),
515 "-inputindex=0",
516 "-scriptpubkey=" + script_pub_key.hex(),
517 "-value=0",
518 expected_stderr="redeemScript failed execution: Non-canonical DER signature\n",
519 )
520 assert (
521 stdout
522 == """\
523======= scriptSig =======
524 Stack (0 items): (empty stack)
525OP 0: 0x05 77726f6e67
526 Stack (1 item):
527 0: 77726f6e67
528OP 1: 0x03 736967
529 Stack (2 items):
530 0: 77726f6e67
531 1: 736967
532OP 2: 0x01 ac
533======= scriptPubKey =======
534 Stack (3 items):
535 0: 77726f6e67
536 1: 736967
537 2: ac
538OP 0: OP_HASH160
539 Stack (3 items):
540 0: 77726f6e67
541 1: 736967
542 2: 17be79cf51aa88feebb0a25e9d6a153ead585e59
543OP 1: 0x14 17be79cf51aa88feebb0a25e9d6a153ead585e59
544 Stack (4 items):
545 0: 77726f6e67
546 1: 736967
547 2: 17be79cf51aa88feebb0a25e9d6a153ead585e59
548 3: 17be79cf51aa88feebb0a25e9d6a153ead585e59
549OP 2: OP_EQUAL
550 Stack (3 items):
551 0: 77726f6e67
552 1: 736967
553 2: 01
554======= redeemScript =======
555 Stack (2 items):
556 0: 77726f6e67
557 1: 736967
558OP 0: OP_CHECKSIG
559"""
560 )
561
562
564 redeem_script = CScript([OP_ADD])
565 tx = CTransaction()
566 tx.vin = [
567 CTxIn(COutPoint(), CScript([b"111111111", b"222222222", bytes(redeem_script)]))
568 ]
569 script_hash = hash160(redeem_script)
570 script_pub_key = CScript([OP_HASH160, script_hash, OP_EQUAL])
571 stdout = iguana(
572 "-tx=" + tx.serialize().hex(),
573 "-inputindex=0",
574 "-scriptpubkey=" + script_pub_key.hex(),
575 "-value=0",
576 expected_stderr="redeemScript failed execution: Integer overflow\n",
577 )
578 assert (
579 stdout
580 == f"""\
581======= scriptSig =======
582 Stack (0 items): (empty stack)
583OP 0: 0x09 313131313131313131
584 Stack (1 item):
585 0: 313131313131313131
586OP 1: 0x09 323232323232323232
587 Stack (2 items):
588 0: 313131313131313131
589 1: 323232323232323232
590OP 2: 0x01 93
591======= scriptPubKey =======
592 Stack (3 items):
593 0: 313131313131313131
594 1: 323232323232323232
595 2: 93
596OP 0: OP_HASH160
597 Stack (3 items):
598 0: 313131313131313131
599 1: 323232323232323232
600 2: {script_hash.hex()}
601OP 1: 0x14 {script_hash.hex()}
602 Stack (4 items):
603 0: 313131313131313131
604 1: 323232323232323232
605 2: {script_hash.hex()}
606 3: {script_hash.hex()}
607OP 2: OP_EQUAL
608 Stack (3 items):
609 0: 313131313131313131
610 1: 323232323232323232
611 2: 01
612======= redeemScript =======
613 Stack (2 items):
614 0: 313131313131313131
615 1: 323232323232323232
616OP 0: OP_ADD
617"""
618 )
619
620
622 redeem_script = CScript([OP_NOP])
623 tx = CTransaction()
624 tx.vin = [CTxIn(COutPoint(), CScript([bytes(redeem_script)]))]
625 script_pub_key = CScript([OP_HASH160, hash160(redeem_script), OP_EQUAL])
626 stdout = iguana(
627 "-tx=" + tx.serialize().hex(),
628 "-inputindex=0",
629 "-scriptpubkey=" + script_pub_key.hex(),
630 "-value=0",
631 expected_stderr="redeemScript failed execution: Script evaluated without error but finished with a false/empty top stack element\n",
632 )
633 assert (
634 stdout
635 == """\
636======= scriptSig =======
637 Stack (0 items): (empty stack)
638OP 0: 0x01 61
639======= scriptPubKey =======
640 Stack (1 item):
641 0: 61
642OP 0: OP_HASH160
643 Stack (1 item):
644 0: 994355199e516ff76c4fa4aab39337b9d84cf12b
645OP 1: 0x14 994355199e516ff76c4fa4aab39337b9d84cf12b
646 Stack (2 items):
647 0: 994355199e516ff76c4fa4aab39337b9d84cf12b
648 1: 994355199e516ff76c4fa4aab39337b9d84cf12b
649OP 2: OP_EQUAL
650 Stack (1 item):
651 0: 01
652======= redeemScript =======
653 Stack (0 items): (empty stack)
654OP 0: OP_NOP
655"""
656 )
657
658
660 redeem_script = CScript([0])
661 tx = CTransaction()
662 tx.vin = [CTxIn(COutPoint(), CScript([bytes(redeem_script)]))]
663 script_pub_key = CScript([OP_HASH160, hash160(redeem_script), OP_EQUAL])
664 stdout = iguana(
665 "-tx=" + tx.serialize().hex(),
666 "-inputindex=0",
667 "-scriptpubkey=" + script_pub_key.hex(),
668 "-value=0",
669 expected_stderr="redeemScript failed execution: Script evaluated without error but finished with a false/empty top stack element\n",
670 )
671 assert (
672 stdout
673 == """\
674======= scriptSig =======
675 Stack (0 items): (empty stack)
676OP 0: 0x01 00
677======= scriptPubKey =======
678 Stack (1 item):
679 0: 00
680OP 0: OP_HASH160
681 Stack (1 item):
682 0: 9f7fd096d37ed2c0e3f7f0cfc924beef4ffceb68
683OP 1: 0x14 9f7fd096d37ed2c0e3f7f0cfc924beef4ffceb68
684 Stack (2 items):
685 0: 9f7fd096d37ed2c0e3f7f0cfc924beef4ffceb68
686 1: 9f7fd096d37ed2c0e3f7f0cfc924beef4ffceb68
687OP 2: OP_EQUAL
688 Stack (1 item):
689 0: 01
690======= redeemScript =======
691 Stack (0 items): (empty stack)
692OP 0: OP_0
693"""
694 )
695
696
698 redeem_script = CScript([0, 1])
699 tx = CTransaction()
700 tx.vin = [CTxIn(COutPoint(), CScript([bytes(redeem_script)]))]
701 script_pub_key = CScript([OP_HASH160, hash160(redeem_script), OP_EQUAL])
702 stdout = iguana(
703 "-tx=" + tx.serialize().hex(),
704 "-inputindex=0",
705 "-scriptpubkey=" + script_pub_key.hex(),
706 "-value=0",
707 expected_stderr="redeemScript failed execution: Stack size must be exactly one after execution\n",
708 )
709 assert (
710 stdout
711 == """\
712======= scriptSig =======
713 Stack (0 items): (empty stack)
714OP 0: 0x02 0051
715======= scriptPubKey =======
716 Stack (1 item):
717 0: 0051
718OP 0: OP_HASH160
719 Stack (1 item):
720 0: 5cbe818a2be9df5479d201af59df9c0bdfaaf21e
721OP 1: 0x14 5cbe818a2be9df5479d201af59df9c0bdfaaf21e
722 Stack (2 items):
723 0: 5cbe818a2be9df5479d201af59df9c0bdfaaf21e
724 1: 5cbe818a2be9df5479d201af59df9c0bdfaaf21e
725OP 2: OP_EQUAL
726 Stack (1 item):
727 0: 01
728======= redeemScript =======
729 Stack (0 items): (empty stack)
730OP 0: OP_0
731 Stack (1 item):
732 0: ""
733OP 1: OP_1
734 Stack (2 items):
735 0: ""
736 1: 01
737"""
738 )
739
740
742 key = ECKey()
743 key.set(b"12345678" * 4, True)
744 redeem_script = CScript([OP_2DUP, OP_CHECKSIGVERIFY] * 3 + [OP_CHECKSIG])
745 script_hash = hash160(redeem_script)
746 script_pub_key = CScript([OP_HASH160, script_hash, OP_EQUAL])
747 tx = CTransaction()
748 tx.vin = [CTxIn(COutPoint())]
749 amount = 1999
750 sighash = SignatureHashForkId(
751 redeem_script, tx, 0, SIGHASH_ALL | SIGHASH_FORKID, amount
752 )
753 sig = key.sign_schnorr(sighash) + b"\x41"
754 pubkey = key.get_pubkey().get_bytes()
755 tx.vin[0].scriptSig = CScript([sig, pubkey, bytes(redeem_script)])
756 stdout = iguana(
757 "-tx=" + tx.serialize().hex(),
758 "-inputindex=0",
759 "-scriptpubkey=" + script_pub_key.hex(),
760 "-value=1999",
761 expected_stderr="redeemScript failed execution: Input SigChecks limit exceeded\n",
762 )
763 assert (
764 stdout
765 == f"""\
766======= scriptSig =======
767 Stack (0 items): (empty stack)
768OP 0: 0x41 {sig.hex()}
769 Stack (1 item):
770 0: {sig.hex()}
771OP 1: 0x21 {pubkey.hex()}
772 Stack (2 items):
773 0: {sig.hex()}
774 1: {pubkey.hex()}
775OP 2: 0x07 {redeem_script.hex()}
776======= scriptPubKey =======
777 Stack (3 items):
778 0: {sig.hex()}
779 1: {pubkey.hex()}
780 2: {redeem_script.hex()}
781OP 0: OP_HASH160
782 Stack (3 items):
783 0: {sig.hex()}
784 1: {pubkey.hex()}
785 2: {script_hash.hex()}
786OP 1: 0x14 {script_hash.hex()}
787 Stack (4 items):
788 0: {sig.hex()}
789 1: {pubkey.hex()}
790 2: {script_hash.hex()}
791 3: {script_hash.hex()}
792OP 2: OP_EQUAL
793 Stack (3 items):
794 0: {sig.hex()}
795 1: {pubkey.hex()}
796 2: 01
797======= redeemScript =======
798 Stack (2 items):
799 0: {sig.hex()}
800 1: {pubkey.hex()}
801OP 0: OP_2DUP
802 Stack (4 items):
803 0: {sig.hex()}
804 1: {pubkey.hex()}
805 2: {sig.hex()}
806 3: {pubkey.hex()}
807OP 1: OP_CHECKSIGVERIFY
808 Stack (2 items):
809 0: {sig.hex()}
810 1: {pubkey.hex()}
811OP 2: OP_2DUP
812 Stack (4 items):
813 0: {sig.hex()}
814 1: {pubkey.hex()}
815 2: {sig.hex()}
816 3: {pubkey.hex()}
817OP 3: OP_CHECKSIGVERIFY
818 Stack (2 items):
819 0: {sig.hex()}
820 1: {pubkey.hex()}
821OP 4: OP_2DUP
822 Stack (4 items):
823 0: {sig.hex()}
824 1: {pubkey.hex()}
825 2: {sig.hex()}
826 3: {pubkey.hex()}
827OP 5: OP_CHECKSIGVERIFY
828 Stack (2 items):
829 0: {sig.hex()}
830 1: {pubkey.hex()}
831OP 6: OP_CHECKSIG
832 Stack (1 item):
833 0: 01
834Number of sigChecks: 4
835"""
836 )
def test_script_pub_key_empty_stack()
Definition: test_iguana.py:338
def test_script_pub_key_unbalanced_conditional()
Definition: test_iguana.py:288
def test_script_sig_invalid_opcode_encoding()
Definition: test_iguana.py:174
def test_script_pub_key_false_stack()
Definition: test_iguana.py:363
def test_redeem_script_false()
Definition: test_iguana.py:659
def test_help()
Definition: test_iguana.py:60
def test_script_pub_key_success()
Definition: test_iguana.py:208
def test_parse_error()
Definition: test_iguana.py:64
def test_redeem_script_error()
Definition: test_iguana.py:508
def test_redeem_script_success()
Definition: test_iguana.py:416
def test_version()
Definition: test_iguana.py:54
def test_sig_push_only()
Definition: test_iguana.py:98
def test_redeem_script_cleanstack()
Definition: test_iguana.py:697
def test_invalid_format()
Definition: test_iguana.py:71
def test_script_pub_key_too_big()
Definition: test_iguana.py:316
def test_redeem_script_exception()
Definition: test_iguana.py:563
def test_script_sig_success()
Definition: test_iguana.py:138
def test_redeem_script_input_sigchecks()
Definition: test_iguana.py:741
def test_script_pub_key_failure()
Definition: test_iguana.py:263
def test_invalid_tx()
Definition: test_iguana.py:78
def test_script_pub_key_cleanstack()
Definition: test_iguana.py:388
def test_invalid_inputindex()
Definition: test_iguana.py:87
def test_redeem_script_empty_stack()
Definition: test_iguana.py:621
def iguana(*args, expected_stderr="", expected_returncode=None)
Definition: test_iguana.py:35