Fix incorrect is_declared_by func

pull/213/head
Josselin 6 years ago
parent 5a9db1d118
commit ea9e46b313
  1. 7
      slither/core/variables/state_variable.py
  2. 7
      slither/core/variables/variable.py

@ -3,6 +3,13 @@ from slither.core.children.child_contract import ChildContract
class StateVariable(ChildContract, Variable): class StateVariable(ChildContract, Variable):
def is_declared_by(self, contract):
"""
Check if the element is declared by the contract
:param contract:
:return:
"""
return self.contract == contract
@property @property
def canonical_name(self): def canonical_name(self):

@ -78,13 +78,6 @@ class Variable(SourceMapping):
assert isinstance(t, (Type, list)) or t is None assert isinstance(t, (Type, list)) or t is None
self._type = t self._type = t
def is_declared_by(self, contract):
"""
Check if the element is declared by the contract
:param contract:
:return:
"""
return self.contract == contract
def __str__(self): def __str__(self):
return self._name return self._name

Loading…
Cancel
Save