From 6cb728e2723f068cfb736a87c3aca8ca3a348a63 Mon Sep 17 00:00:00 2001 From: z80 Date: Mon, 23 Oct 2023 23:57:21 -0400 Subject: [PATCH] fix: properly handle rest of settings needed for per-optimization-level compilation --- ape_vyper/compiler.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ape_vyper/compiler.py b/ape_vyper/compiler.py index a3a5068c..3899bc19 100644 --- a/ape_vyper/compiler.py +++ b/ape_vyper/compiler.py @@ -303,10 +303,12 @@ def compile( for vyper_version, source_paths in version_map.items(): settings = all_settings.get(vyper_version, {}) - path_args = {str(get_relative_path(p.absolute(), base_path)): p for p in source_paths} optimizations_map = self.get_optimization_pragma_map(list(source_paths)) - for optimization, paths in optimizations_map.items(): + for optimization, source_paths in optimizations_map.items(): + path_args = { + str(get_relative_path(p.absolute(), base_path)): p for p in source_paths + } input_json = { "language": "Vyper", "settings": settings, @@ -314,6 +316,7 @@ def compile( } input_json["settings"]["optimize"] = optimization + input_json["settings"]["outputSelection"] = {s: ["*"] for s in path_args} if interfaces := self.import_remapping: input_json["interfaces"] = interfaces @@ -480,10 +483,6 @@ def get_compiler_settings( continue version_settings: Dict = {"optimize": True} - path_args = { - str(get_relative_path(p.absolute(), contracts_path)): p for p in source_paths - } - version_settings["outputSelection"] = {s: ["*"] for s in path_args} if evm_version := data.get("evm_version"): version_settings["evmVersion"] = evm_version