Skip to content

Commit 36945ff

Browse files
iliastsadguido
authored andcommitted
refac: Change from named parameter to special kwarg for backwards compatibility
1 parent b0de88e commit 36945ff

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

crytic_compile/crytic_compile.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ class CryticCompile:
113113
Main class.
114114
"""
115115

116-
def __init__(
117-
self, target: str | AbstractPlatform, defer_compilation: bool = False, **kwargs: str
118-
) -> None:
116+
# pylint: disable=too-many-branches
117+
def __init__(self, target: str | AbstractPlatform, **kwargs: str) -> None:
119118
"""See https://github.com/crytic/crytic-compile/wiki/Configuration
120119
Target is usually a file or a project directory. It can be an AbstractPlatform
121120
for custom setup
@@ -209,7 +208,7 @@ def __init__(
209208

210209
self.compilation_kwargs = kwargs
211210

212-
if not defer_compilation:
211+
if not kwargs.get("crytic_defer_compilation") == "true":
213212
self._compile(**kwargs)
214213

215214
@property

tests/test_metadata.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ def test_metadata_deferred() -> None:
5050
"""Test the metadata with deferred compilation."""
5151
crytic_compile_instance = CryticCompile(
5252
"0x6B175474E89094C44Da98b954EedeAC495271d0F", # solc 0.5.12
53-
defer_compilation=True,
53+
crytic_defer_compilation="true",
5454
)
5555
assert len(crytic_compile_instance.compilation_units) == 0
5656

5757
crytic_compile_instance.compile()
5858

5959
metadata_checks(crytic_compile_instance)
60-

0 commit comments

Comments
 (0)