Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Merge branch 'development' of github.com:CityOfZion/neo-boa into deve…
Browse files Browse the repository at this point in the history
…lopment
  • Loading branch information
localhuman committed Jan 1, 2018
2 parents 5cd185e + ea504e7 commit aad18d8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
8 changes: 0 additions & 8 deletions boa/blockchain/vm/VMOp.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ def ToName(op):
for item in items:
n = getattr(module, item)

try:
nn = int(binascii.hexlify(n))

if op == nn:
return item
except Exception as e:
pass

try:
nn2 = int.from_bytes(n, 'little')
if op == nn2:
Expand Down
21 changes: 13 additions & 8 deletions boa/code/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,21 +537,26 @@ def to_s(self):
pass

if pt.py_op == pyop.CALL_FUNCTION:
old = to_label
to_label = '%s %s %s' % (pt.func_name, pt.func_params, old)
if to_label is None:
old = ""
else:
old = to_label
param_string = "("
for param in pt.func_params:
param_string += str(param.args) + ", "
param_string = param_string.rstrip(", ") + ")"
to_label = '%s %s %s' % (pt.func_name, param_string, old)

lno = "{:<10}".format(
pt.line_no if do_print_line_no or pstart else '')
addr = "{:<5}".format(key)
op = "{:<20}".format(str(pt.py_op))
try:
# Check if it is an integer (this is likely a custom boa op)
int(str(pt.py_op))
opname = pyop.ToName(pt.py_op)

# If this is a number, it is likely a custom python opcode, get the name
if str(pt.py_op).isnumeric():
opname = pyop.ToName(int(str(pt.py_op)))
if opname is not None:
op = "{:<20}".format(opname)
except ValueError:
pass

arg = "{:<50}".format(
to_label if to_label is not None else pt.arg_s)
Expand Down
2 changes: 1 addition & 1 deletion boa/code/pyop.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,4 @@ def ToName(op):
n = getattr(module, item)
if op == n:
return item
return None
return None

0 comments on commit aad18d8

Please sign in to comment.