def __hash__(self): if len(self.instructions): #return the hash of the first pushdata instruction for instr in self.instructions: if is_pushdata(instr.opcode): return hash(self.instruction[0]) #or the hash of the first instruction if there is no pushdata return hash(self.instruction[0]) return 0
def normalize_pushdata(opcodes): return [(is_pushdata(op) and OP_PUSHDATA or op) for op in opcodes]
def is_pushdata(self): return is_pushdata(self.opcode)