def tbf(*args): pc, opcode, data, stack, altstack, is_signature, is_condition = args from pycoin.tx.script.tools import disassemble_for_opcode_data opd = disassemble_for_opcode_data(opcode, data) if len(altstack) == 0: altstack = '' print("%s %s\n %3x %s" % (stack, altstack, pc, opd)) import pdb pdb.set_trace()
def get_word(script_bin, index): pc = 0 i = 0 while pc < len(script_bin) and i <= index: opcode, data, pc = tools.get_opcode(script_bin, pc) i += 1 if i != index + 1: raise ValueError(index) return opcode, data, tools.disassemble_for_opcode_data(opcode, data)
def get_word(script, index): pc = 0 i = 0 while pc < len(script) and i <= index: opcode, data, pc = tools.get_opcode(script, pc) i += 1 if i != index + 1: raise ValueError(index) return opcode, data, tools.disassemble_for_opcode_data(opcode, data)
def trace_script(pc, opcode, data, stack, altstack, if_condition_stack, is_signature): from pycoin.serialize import b2h print("stack: [%s]" % ' '.join(b2h(s) for s in stack)) if len(altstack) > 0: print("altstack: %s" % altstack) print("condition stack: %s" % if_condition_stack) print("%3d : %02x %s" % (pc, opcode, disassemble_for_opcode_data(opcode, data))) if use_pdb: import pdb pdb.set_trace()