type_parsing: parse enums that begin with `type(enum`

pull/730/head
Maximilian Krueger 4 years ago
parent 1c12a13b95
commit b4c792a9e4
  1. 2
      slither/solc_parsing/solidity_types/type_parsing.py

@ -71,6 +71,8 @@ def _find_from_type_name( # pylint: disable=too-many-locals,too-many-branches,t
enum_name = name
if enum_name.startswith("enum "):
enum_name = enum_name[len("enum ") :]
elif enum_name.startswith("type(enum"):
enum_name = enum_name[len("type(enum ") : -1]
all_enums = [c.enums for c in contracts]
all_enums = [item for sublist in all_enums for item in sublist]
var_type = next((e for e in all_enums if e.name == enum_name), None)

Loading…
Cancel
Save