From e78e81a14f7314ed7a269cf864004e35f0ab1eff Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Sun, 29 Oct 2023 17:03:52 -0400 Subject: [PATCH] use input_bundle.load_file in vyper_compile.py --- vyper/cli/vyper_compile.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/vyper/cli/vyper_compile.py b/vyper/cli/vyper_compile.py index 3fe1b27edd..1e24fe64e5 100755 --- a/vyper/cli/vyper_compile.py +++ b/vyper/cli/vyper_compile.py @@ -3,7 +3,6 @@ import json import sys import warnings -from collections import OrderedDict from pathlib import Path from typing import Iterable, Iterator, Optional, Set, TypeVar @@ -227,20 +226,18 @@ def compile_files( settings: Optional[Settings] = None, storage_layout: Optional[Iterable[str]] = None, no_bytecode_metadata: bool = False, -) -> OrderedDict: +) -> dict: root_path = Path(root_folder).resolve() if not root_path.exists(): raise FileNotFoundError(f"Invalid root path - '{root_path.as_posix()}' does not exist") input_bundle = FilesystemInputBundle([root_path]) - contract_sources: ContractCodes = OrderedDict() + contract_sources: ContractCodes = dict() for file_name in input_files: - file_path = Path(file_name) - with file_path.open() as fh: - contract_sources[file_path] = fh.read() + contract_sources[file_path] = input_bundle.load_file(Path(file_path)) - storage_layouts = OrderedDict() + storage_layouts = dict() if storage_layout: for storage_file_name, contract_name in zip(storage_layout, contract_sources.keys()): storage_file_path = Path(storage_file_name)