Skip to content

Commit

Permalink
More compact dict syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
cameel committed Jul 20, 2023
1 parent 9ed4a47 commit ebf789d
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions scripts/externalTests/runners/foundry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]):
Expand All @@ -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,
Expand Down

0 comments on commit ebf789d

Please sign in to comment.