diff --git a/src/kontrol/__main__.py b/src/kontrol/__main__.py index 45591dd16..737148e95 100644 --- a/src/kontrol/__main__.py +++ b/src/kontrol/__main__.py @@ -6,8 +6,8 @@ from argparse import ArgumentParser from typing import TYPE_CHECKING +from kevm_pyk import kdist from kevm_pyk.cli import node_id_like -from kevm_pyk.dist import DistTarget from kevm_pyk.utils import arg_pair_of from pyk.cli.utils import file_path from pyk.proof.tui import APRProofViewer @@ -87,14 +87,14 @@ def exec_solc_to_k( main_module: str | None, requires: list[str], imports: list[str], - target: DistTarget | None = None, + target: str | None = None, **kwargs: Any, ) -> None: if target is None: - target = DistTarget.HASKELL + target = 'haskell' k_text = solc_to_k( - definition_dir=target.get(), + definition_dir=kdist.get(target), contract_file=contract_file, contract_name=contract_name, main_module=main_module, diff --git a/src/kontrol/kompile.py b/src/kontrol/kompile.py index 5f734847a..41f04781c 100644 --- a/src/kontrol/kompile.py +++ b/src/kontrol/kompile.py @@ -6,7 +6,7 @@ from pathlib import Path from typing import TYPE_CHECKING -from kevm_pyk.dist import DistTarget +from kevm_pyk import kdist from kevm_pyk.kevm import KEVM from kevm_pyk.kompile import KompileTarget, kevm_kompile from pyk.kast.outer import KDefinition, KFlatModule, KImport, KRequire @@ -82,7 +82,7 @@ def foundry_kompile( copied_requires = [] copied_requires += [f'requires/{name}' for name in list(requires_paths.keys())] imports = ['FOUNDRY'] - kevm = KEVM(DistTarget.FOUNDRY.get()) + kevm = KEVM(kdist.get('foundry')) empty_config = kevm.definition.empty_config(Foundry.Sorts.FOUNDRY_CELL) bin_runtime_definition = _foundry_to_contract_def( empty_config=empty_config, @@ -99,7 +99,7 @@ def foundry_kompile( ) kevm = KEVM( - DistTarget.FOUNDRY.get(), + kdist.get('foundry'), extra_unparsing_modules=(bin_runtime_definition.all_modules + contract_main_definition.all_modules), ) foundry_contracts_file.write_text(kevm.pretty_print(bin_runtime_definition, unalias=False) + '\n') diff --git a/src/tests/integration/utils.py b/src/tests/integration/utils.py index cb96bd293..2c59cf1cb 100644 --- a/src/tests/integration/utils.py +++ b/src/tests/integration/utils.py @@ -3,7 +3,7 @@ from pathlib import Path from typing import TYPE_CHECKING -from kevm_pyk.dist import DistTarget +from kevm_pyk import kdist from pyk.utils import check_dir_path from kontrol.solc_to_k import solc_to_k @@ -23,7 +23,7 @@ def gen_bin_runtime(contract_file: Path, output_dir: Path) -> tuple[Path, str]: main_file = output_dir / f'{contract_name.lower()}-bin-runtime.k' k_text = solc_to_k( - definition_dir=DistTarget.HASKELL.get(), + definition_dir=kdist.get('haskell'), contract_file=contract_file, contract_name=contract_name, main_module=main_module_name,