Skip to content

Commit

Permalink
Update literal.py
Browse files Browse the repository at this point in the history
  • Loading branch information
montyly authored Jan 9, 2023
1 parent 2684717 commit 811dd78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions slither/core/expressions/literal.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def value(self) -> Union[int, str]:
return self._value

@property
def converted_value(self) -> int:
def converted_value(self) -> Union[int, str]:
"""Return the value of the literal, accounting for subdenomination e.g. ether"""
if self.subdenomination:
return convert_subdenomination(self._value, self.subdenomination)
Expand All @@ -37,7 +37,7 @@ def type(self) -> "Type":
def subdenomination(self) -> Optional[str]:
return self._subdenomination

def __str__(self):
def __str__(self) -> str:
if self.subdenomination:
return str(self.converted_value)

Expand All @@ -47,7 +47,7 @@ def __str__(self):
# be sure to handle any character
return str(self._value)

def __eq__(self, other):
def __eq__(self, other) -> bool:
if not isinstance(other, Literal):
return False
return (self.value, self.subdenomination) == (other.value, other.subdenomination)

0 comments on commit 811dd78

Please sign in to comment.