Skip to content

Commit

Permalink
hint clvm_tools.binutils.disassemble() (#90)
Browse files Browse the repository at this point in the history
* hint clvm_tools.binutils.disassemble()
  • Loading branch information
altendky authored Oct 3, 2022
1 parent 8c263e1 commit 6651fa4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clvm_tools/binutils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import string
from typing import Dict

from clvm import KEYWORD_FROM_ATOM, KEYWORD_TO_ATOM
from clvm.casts import int_from_bytes, int_to_bytes
from clvm.SExp import SExp

from ir.reader import read_ir
from ir.writer import write_ir
Expand Down Expand Up @@ -80,7 +82,7 @@ def disassemble_to_ir(sexp, keyword_from_atom, allow_keyword=None):
return sexp.to((type_for_atom(as_atom), as_atom))


def disassemble(sexp, keyword_from_atom=KEYWORD_FROM_ATOM):
def disassemble(sexp: SExp, keyword_from_atom: Dict[bytes, str] = KEYWORD_FROM_ATOM) -> str:
symbols = disassemble_to_ir(sexp, keyword_from_atom=keyword_from_atom)
return write_ir(symbols)

Expand Down

0 comments on commit 6651fa4

Please sign in to comment.