Cooked' iteration Returns either a CScriptOP instance, an integer, or bytes, as appropriate. See raw_iter() if you need to distinguish the different possible PUSHDATA encodings.
(self)
| 765 | yield (opcode, data, sop_idx) |
| 766 | |
| 767 | def __iter__(self): |
| 768 | """'Cooked' iteration |
| 769 | |
| 770 | Returns either a CScriptOP instance, an integer, or bytes, as |
| 771 | appropriate. |
| 772 | |
| 773 | See raw_iter() if you need to distinguish the different possible |
| 774 | PUSHDATA encodings. |
| 775 | """ |
| 776 | for (opcode, data, sop_idx) in self.raw_iter(): |
| 777 | if data is not None: |
| 778 | yield data |
| 779 | else: |
| 780 | opcode = CScriptOp(opcode) |
| 781 | |
| 782 | if opcode.is_small_int(): |
| 783 | yield opcode.decode_op_n() |
| 784 | else: |
| 785 | yield CScriptOp(opcode) |
| 786 | |
| 787 | def __repr__(self): |
| 788 | # For Python3 compatibility add b before strings so testcases don't |
nothing calls this directly
no test coverage detected