(self)
| 39 | self.cmds = cmds |
| 40 | |
| 41 | def __repr__(self): |
| 42 | result = [] |
| 43 | for cmd in self.cmds: |
| 44 | if type(cmd) == int: |
| 45 | if OP_CODE_NAMES.get(cmd): |
| 46 | name = OP_CODE_NAMES.get(cmd) |
| 47 | else: |
| 48 | name = 'OP_[{}]'.format(cmd) |
| 49 | result.append(name) |
| 50 | else: |
| 51 | result.append(cmd.hex()) |
| 52 | return ' '.join(result) |
| 53 | |
| 54 | def __add__(self, other): |
| 55 | return Script(self.cmds + other.cmds) |