Skip to content

Commit

Permalink
Re-add contract.contract_not_inherited
Browse files Browse the repository at this point in the history
  • Loading branch information
montyly committed Jan 24, 2019
1 parent bfd3dbb commit 1195894
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions slither/core/declarations/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,19 @@ def constructor(self):
executed, following the c3 linearization
Return None if there is no constructor.
'''
cst = next((func for func in self.functions if func.is_constructor and func.contract == self), None)
cst = self.constructor_not_inherited
if cst:
return cst
for inherited_contract in self.inheritance:
cst = inherited_contract.constructor
cst = inherited_contract.constructor_not_inherited
if cst:
return cst
return None

@property
def constructor_not_inherited(self):
return next((func for func in self.functions if func.is_constructor and func.contract == self), None)

@property
def constructors(self):
'''
Expand Down

0 comments on commit 1195894

Please sign in to comment.