MCPcopy Create free account
hub / github.com/LUX-Core/lux / __iter__

Method __iter__

test/functional/test_framework/script.py:767–785  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

raw_iterMethod · 0.95
is_small_intMethod · 0.95
decode_op_nMethod · 0.95
CScriptOpClass · 0.70

Tested by

no test coverage detected