Fix detector output

Floats were being used by mistake, so the output ended up being in
scientific notation.
pull/1377/head
Emilio López 2 years ago
parent 237bb53591
commit e7e411ba0e
  1. 2
      slither/core/expressions/literal.py
  2. 8
      slither/utils/arithmetic.py

@ -1,7 +1,7 @@
from typing import Optional, Union, TYPE_CHECKING
from slither.core.expressions.expression import Expression
from slither.core.solidity_types.elementary_type import Byte, Fixed, Int, Ufixed, Uint
from slither.core.solidity_types.elementary_type import Fixed, Int, Ufixed, Uint
from slither.utils.arithmetic import convert_subdenomination
from slither.utils.integer_conversion import convert_string_to_int

@ -12,13 +12,13 @@ def convert_subdenomination(
if sub == "wei":
return decimal_value
if sub == "gwei":
return decimal_value * 1e9
return decimal_value * int(1e9)
if sub == "szabo":
return decimal_value * 1e12
return decimal_value * int(1e12)
if sub == "finney":
return decimal_value * 1e15
return decimal_value * int(1e15)
if sub == "ether":
return decimal_value * 1e18
return decimal_value * int(1e18)
if sub == "seconds":
return decimal_value
if sub == "minutes":

Loading…
Cancel
Save