Pylint and black

pull/1730/head
webthethird 2 years ago
parent 7532baae57
commit 6d685711dd
  1. 9
      slither/utils/code_generation.py
  2. 5
      tests/test_code_generation.py

@ -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:
@ -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"

@ -3,11 +3,8 @@ import os
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__)))
@ -26,5 +23,3 @@ def test_interface_generation() -> None:
expected = file.read()
assert actual == expected

Loading…
Cancel
Save