From ebf789dd69f19fb1684f86030e55405b7d5d7979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Thu, 20 Jul 2023 16:32:32 +0200 Subject: [PATCH] More compact dict syntax --- scripts/externalTests/runners/foundry.py | 29 ++++++++---------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/scripts/externalTests/runners/foundry.py b/scripts/externalTests/runners/foundry.py index d156acc31bf5..8cae0c76f4ec 100644 --- a/scripts/externalTests/runners/foundry.py +++ b/scripts/externalTests/runners/foundry.py @@ -65,14 +65,7 @@ def profile_section(profile_fields: dict) -> str: [profile.{name}.optimizer_details] yul = {yul} - """).format( - name=profile_fields["name"], - solc=profile_fields["solc"], - evm_version=profile_fields["evm_version"], - optimizer=profile_fields["optimizer"], - via_ir=profile_fields["via_ir"], - yul=profile_fields["yul"], - ) + """).format(**profile_fields) @TestRunner.on_local_test_dir def configure(self, presets: List[SettingsPreset]): @@ -81,18 +74,14 @@ def configure(self, presets: List[SettingsPreset]): profiles = [] for preset in presets: settings = settings_from_preset(preset, self.config.evm_version) - profiles.append( - self.profile_section( - { - "name": self.profile_name(preset), - "solc": self.solc_binary_path, - "evm_version": self.config.evm_version, - "optimizer": str(settings["optimizer"]["enabled"]).lower(), - "via_ir": str(settings["viaIR"]).lower(), - "yul": str(settings["optimizer"]["details"]["yul"]).lower(), - } - ) - ) + profiles.append(self.profile_section({ + "name": self.profile_name(preset), + "solc": self.solc_binary_path, + "evm_version": self.config.evm_version, + "optimizer": str(settings["optimizer"]["enabled"]).lower(), + "via_ir": str(settings["viaIR"]).lower(), + "yul": str(settings["optimizer"]["details"]["yul"]).lower(), + })) with open( file=self.test_dir / self.foundry_config_file,