Skip to content

Commit

Permalink
API changes:
Browse files Browse the repository at this point in the history
- Remove contract.get_functions_overridden_by
- Add function.functions_shadowed
  • Loading branch information
montyly committed Jan 4, 2019
1 parent b549a3e commit 57a0918
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
11 changes: 0 additions & 11 deletions slither/core/declarations/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,6 @@ def functions_and_modifiers_not_inherited(self):
'''
return self.functions_not_inherited + self.modifiers_not_inherited

def get_functions_overridden_by(self, function):
'''
Return the list of functions overriden by the function
Args:
(core.Function)
Returns:
list(core.Function)
'''
candidates = self.functions_inherited
return [f for f in candidates if f.name == function]

@property
def all_functions_called(self):
Expand Down
12 changes: 12 additions & 0 deletions slither/core/declarations/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,18 @@ def full_name(self):
name, parameters, _ = self.signature
return name+'('+','.join(parameters)+')'

@property
def functions_shadowed(self):
'''
Return the list of functions shadowed
Returns:
list(core.Function)
'''
candidates = [c.functions_not_inherited for c in self.contract.inheritance]
candidates = [candidate for sublist in candidates for candidate in sublist]
return [f for f in candidates if f.full_name == self.full_name]


@property
def slither(self):
Expand Down

0 comments on commit 57a0918

Please sign in to comment.