|
|
@ -2,7 +2,7 @@ from decimal import Decimal |
|
|
|
|
|
|
|
|
|
|
|
from slither.exceptions import SlitherException |
|
|
|
from slither.exceptions import SlitherException |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# pylint: disable=too-many-branches |
|
|
|
def convert_subdenomination( |
|
|
|
def convert_subdenomination( |
|
|
|
value: str, sub: str |
|
|
|
value: str, sub: str |
|
|
|
) -> int: # pylint: disable=too-many-return-statements |
|
|
|
) -> int: # pylint: disable=too-many-return-statements |
|
|
@ -14,6 +14,8 @@ def convert_subdenomination( |
|
|
|
decimal_value = Decimal(value) |
|
|
|
decimal_value = Decimal(value) |
|
|
|
if sub == "wei": |
|
|
|
if sub == "wei": |
|
|
|
return int(decimal_value) |
|
|
|
return int(decimal_value) |
|
|
|
|
|
|
|
if sub == "gwei": |
|
|
|
|
|
|
|
return int(decimal_value * int(1e9)) |
|
|
|
if sub == "szabo": |
|
|
|
if sub == "szabo": |
|
|
|
return int(decimal_value * int(1e12)) |
|
|
|
return int(decimal_value * int(1e12)) |
|
|
|
if sub == "finney": |
|
|
|
if sub == "finney": |
|
|
|