From 811dd78b482d037e34044fa9d68a6ddb5202f962 Mon Sep 17 00:00:00 2001 From: Feist Josselin Date: Mon, 9 Jan 2023 14:40:44 +0100 Subject: [PATCH] Update literal.py --- slither/core/expressions/literal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slither/core/expressions/literal.py b/slither/core/expressions/literal.py index 328ec9674..2eaeb715d 100644 --- a/slither/core/expressions/literal.py +++ b/slither/core/expressions/literal.py @@ -23,7 +23,7 @@ class Literal(Expression): 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) @@ -37,7 +37,7 @@ class Literal(Expression): def subdenomination(self) -> Optional[str]: return self._subdenomination - def __str__(self): + def __str__(self) -> str: if self.subdenomination: return str(self.converted_value) @@ -47,7 +47,7 @@ class Literal(Expression): # 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)