MCPcopy Create free account
hub / github.com/ElementsProject/elements / __iter__

Method __iter__

test/functional/test_framework/script.py:619–637  ·  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

617 yield (opcode, data, sop_idx)
618
619 def __iter__(self):
620 """'Cooked' iteration
621
622 Returns either a CScriptOP instance, an integer, or bytes, as
623 appropriate.
624
625 See raw_iter() if you need to distinguish the different possible
626 PUSHDATA encodings.
627 """
628 for (opcode, data, sop_idx) in self.raw_iter():
629 if data is not None:
630 yield data
631 else:
632 opcode = CScriptOp(opcode)
633
634 if opcode.is_small_int():
635 yield opcode.decode_op_n()
636 else:
637 yield CScriptOp(opcode)
638
639 def __repr__(self):
640 def _repr(o):

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