Almost completely ditch src/util/clvm.py.
This commit is contained in:
parent
431ab0bf70
commit
741928d5da
|
@ -2,15 +2,36 @@ import io
|
||||||
from typing import Any, List, Optional, Set, Tuple
|
from typing import Any, List, Optional, Set, Tuple
|
||||||
|
|
||||||
from src.types.sized_bytes import bytes32
|
from src.types.sized_bytes import bytes32
|
||||||
from src.util.clvm import run_program, sexp_from_stream, sexp_to_stream
|
|
||||||
from src.util.hash import std_hash
|
from src.util.hash import std_hash
|
||||||
|
|
||||||
from clvm import SExp
|
from clvm import run_program as default_run_program, KEYWORD_TO_ATOM, SExp
|
||||||
from clvm.EvalError import EvalError
|
|
||||||
from clvm.casts import int_from_bytes
|
from clvm.casts import int_from_bytes
|
||||||
|
from clvm.operators import OPERATOR_LOOKUP
|
||||||
|
from clvm.serialize import sexp_from_stream, sexp_to_stream
|
||||||
|
from clvm.EvalError import EvalError
|
||||||
|
|
||||||
from clvm_tools.curry import curry, uncurry
|
from clvm_tools.curry import curry, uncurry
|
||||||
|
|
||||||
|
|
||||||
|
def run_program(
|
||||||
|
program,
|
||||||
|
args,
|
||||||
|
quote_kw=KEYWORD_TO_ATOM["q"],
|
||||||
|
args_kw=KEYWORD_TO_ATOM["a"],
|
||||||
|
operator_lookup=OPERATOR_LOOKUP,
|
||||||
|
max_cost=None,
|
||||||
|
pre_eval_f=None,
|
||||||
|
):
|
||||||
|
return default_run_program(
|
||||||
|
program,
|
||||||
|
args,
|
||||||
|
quote_kw,
|
||||||
|
operator_lookup,
|
||||||
|
max_cost,
|
||||||
|
pre_eval_f=pre_eval_f,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Program(SExp):
|
class Program(SExp):
|
||||||
"""
|
"""
|
||||||
A thin wrapper around s-expression data intended to be invoked with "eval".
|
A thin wrapper around s-expression data intended to be invoked with "eval".
|
||||||
|
|
|
@ -1,24 +1 @@
|
||||||
from clvm import run_program as default_run_program, KEYWORD_TO_ATOM # noqa
|
|
||||||
from clvm.operators import OPERATOR_LOOKUP # noqa
|
|
||||||
from clvm.EvalError import EvalError # noqa
|
|
||||||
from clvm.casts import int_from_bytes, int_to_bytes # noqa
|
from clvm.casts import int_from_bytes, int_to_bytes # noqa
|
||||||
from clvm.serialize import sexp_from_stream, sexp_to_stream # noqa
|
|
||||||
|
|
||||||
|
|
||||||
def run_program(
|
|
||||||
program,
|
|
||||||
args,
|
|
||||||
quote_kw=KEYWORD_TO_ATOM["q"],
|
|
||||||
args_kw=KEYWORD_TO_ATOM["a"],
|
|
||||||
operator_lookup=OPERATOR_LOOKUP,
|
|
||||||
max_cost=None,
|
|
||||||
pre_eval_f=None,
|
|
||||||
):
|
|
||||||
return default_run_program(
|
|
||||||
program,
|
|
||||||
args,
|
|
||||||
quote_kw,
|
|
||||||
operator_lookup,
|
|
||||||
max_cost,
|
|
||||||
pre_eval_f=pre_eval_f,
|
|
||||||
)
|
|
||||||
|
|
Loading…
Reference in New Issue