Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tuturu-tech committed Mar 6, 2024
1 parent 0fa2701 commit 59bd498
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion fuzz_utils/fuzzers/Echidna.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class Echidna:
Handles the generation of Foundry test files from Echidna reproducers
"""

def __init__(self, target_name: str, corpus_path: str, slither: Slither, named_inputs: bool) -> None:
def __init__(
self, target_name: str, corpus_path: str, slither: Slither, named_inputs: bool
) -> None:
self.name = "Echidna"
self.target_name = target_name
self.slither = slither
Expand Down Expand Up @@ -59,6 +61,7 @@ def parse_reproducer(self, calls: Any, index: int) -> str:
template = jinja2.Template(templates["TEST"])
return template.render(function_name=function_name, call_list=call_list)

# pylint: disable=too-many-locals,too-many-branches
def _parse_call_object(self, call_dict: dict[Any, Any]) -> tuple[str, str]:
"""
Takes a single call dictionary, parses it, and returns the series of function calls as a string, along with
Expand Down
5 changes: 4 additions & 1 deletion fuzz_utils/fuzzers/Medusa.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class Medusa:
Handles the generation of Foundry test files from Medusa reproducers
"""

def __init__(self, target_name: str, corpus_path: str, slither: Slither, named_inputs: bool) -> None:
def __init__(
self, target_name: str, corpus_path: str, slither: Slither, named_inputs: bool
) -> None:
self.name = "Medusa"
self.target_name = target_name
self.corpus_path = corpus_path
Expand Down Expand Up @@ -62,6 +64,7 @@ def parse_reproducer(self, calls: Any, index: int) -> str:
# 3. Using the call list to generate a test string
# 4. Return the test string

# pylint: disable=too-many-locals,too-many-branches
def _parse_call_object(self, call_dict: dict) -> tuple[str, str]:
"""
Takes a single call dictionary, parses it, and returns the series of function calls as a string, along with
Expand Down
2 changes: 1 addition & 1 deletion fuzz_utils/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def main() -> None: # type: ignore[func-returns-value]
dest="named_inputs",
help="Include function input names when making calls.",
default=False,
action='store_true',
action="store_true",
)

args = parser.parse_args()
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class TestGenerator:

def __init__(self, target: str, target_path: str, corpus_dir: str):
slither = Slither(target_path)
echidna = Echidna(target, f"echidna-corpora/{corpus_dir}", slither)
medusa = Medusa(target, f"medusa-corpora/{corpus_dir}", slither)
echidna = Echidna(target, f"echidna-corpora/{corpus_dir}", slither, False)
medusa = Medusa(target, f"medusa-corpora/{corpus_dir}", slither, False)
self.echidna_generator = FoundryTest(
"../src/", target, f"echidna-corpora/{corpus_dir}", "./test/", slither, echidna
)
Expand Down

0 comments on commit 59bd498

Please sign in to comment.