Improved handling of negative constants (#683)

pull/695/head
Gustavo Grieco 3 years ago committed by GitHub
parent ed064f14c7
commit 8e010faac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lib/Echidna/ABI.hs

@ -59,7 +59,7 @@ mkValidAbiUInt :: Int -> Word256 -> Maybe AbiValue
mkValidAbiUInt i x = if x <= 2 ^ i - 1 then Just $ AbiUInt i x else Nothing
makeNumAbiValues :: Integer -> [AbiValue]
makeNumAbiValues i = let l f = f <$> commonTypeSizes <*> fmap fromIntegral [i-1..i+1] in
makeNumAbiValues i = let l f = f <$> commonTypeSizes <*> fmap fromIntegral ([i-1..i+1] ++ [(-i)-1 .. (-i)+1]) in
catMaybes (l mkValidAbiInt ++ l mkValidAbiUInt)
makeArrayAbiValues :: BS.ByteString -> [AbiValue]

Loading…
Cancel
Save