Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/script.py
Show First 20 Lines • Show All 558 Lines • ▼ Show 20 Lines | def __iter__(self): | ||||
opcode = CScriptOp(opcode) | opcode = CScriptOp(opcode) | ||||
if opcode.is_small_int(): | if opcode.is_small_int(): | ||||
yield opcode.decode_op_n() | yield opcode.decode_op_n() | ||||
else: | else: | ||||
yield CScriptOp(opcode) | yield CScriptOp(opcode) | ||||
def __repr__(self): | def __repr__(self): | ||||
# For Python3 compatibility add b before strings so testcases don't | |||||
# need to change | |||||
def _repr(o): | def _repr(o): | ||||
if isinstance(o, bytes): | if isinstance(o, bytes): | ||||
return "x('{}')".format(hexlify(o).decode('ascii')).encode() | return "x('{}')".format(hexlify(o).decode('ascii')) | ||||
else: | else: | ||||
return repr(o) | return repr(o) | ||||
ops = [] | ops = [] | ||||
i = iter(self) | i = iter(self) | ||||
while True: | while True: | ||||
op = None | op = None | ||||
try: | try: | ||||
▲ Show 20 Lines • Show All 156 Lines • Show Last 20 Lines |