Skip to content

Commit

Permalink
Pylint and black
Browse files Browse the repository at this point in the history
  • Loading branch information
webthethird committed Mar 20, 2023
1 parent 7532baa commit 6d68571
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
9 changes: 6 additions & 3 deletions slither/utils/code_generation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Functions for generating Solidity code
from typing import TYPE_CHECKING, Optional

from slither.core.solidity_types.user_defined_type import UserDefinedType
from slither.utils.type import convert_type_for_solidity_signature_to_string

if TYPE_CHECKING:
Expand All @@ -23,8 +22,12 @@ def generate_interface(contract: "Contract") -> str:
name, args = event.signature
interface += f" event {name}({', '.join(args)});\n"
for error in contract.custom_errors:
args = [convert_type_for_solidity_signature_to_string(arg.type).replace("(", "").replace(")", "")
for arg in error.parameters]
args = [
convert_type_for_solidity_signature_to_string(arg.type)
.replace("(", "")
.replace(")", "")
for arg in error.parameters
]
interface += f" error {error.name}({', '.join(args)});\n"
for enum in contract.enums:
interface += f" enum {enum.name} {{ {', '.join(enum.values)} }}\n"
Expand Down
5 changes: 0 additions & 5 deletions tests/test_code_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
from solc_select import solc_select

from slither import Slither
from slither.core.expressions import Literal
from slither.utils.code_generation import (
generate_interface,
generate_interface_function_signature,
generate_struct_interface_str,
)

SLITHER_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand All @@ -26,5 +23,3 @@ def test_interface_generation() -> None:
expected = file.read()

assert actual == expected


0 comments on commit 6d68571

Please sign in to comment.