ethereum-analyzer-deps 3.2.0 → 3.3.0
raw patch · 6 files changed
+38/−60 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Blockchain.VM.Opcodes: REVERT :: Operation
Files
- ethereum-analyzer-deps.cabal +2/−2
- src/Blockchain/Data/Code.hs +1/−1
- src/Blockchain/Util.hs +1/−3
- src/Blockchain/VM/Opcodes.hs +3/−1
- src/Legacy/Haskoin/V0102/Network/Haskoin/Crypto/BigWord.hs +15/−25
- src/Legacy/Haskoin/V0102/Network/Haskoin/Util.hs +16/−28
ethereum-analyzer-deps.cabal view
@@ -1,5 +1,5 @@ name: ethereum-analyzer-deps-version: 3.2.0+version: 3.3.0 cabal-version: >=1.10 build-type: Simple author: Jamshid@@ -15,7 +15,7 @@ type: git location: https://github.com/zchn/ethereum-analyzer branch: master- tag: v3.2.0+ tag: v3.3.0 library default-language: Haskell98
src/Blockchain/Data/Code.hs view
@@ -8,7 +8,7 @@ import Blockchain.Data.RLP data Code- = Code { codeBytes :: B.ByteString}+ = Code { codeBytes :: B.ByteString } | PrecompiledCode Int deriving (Show, Eq, Read, Ord, Generic)
src/Blockchain/Util.hs view
@@ -100,9 +100,7 @@ | i > 0x7fffffffffffffff = error "error in call to safeDrop: string too long" safeDrop i s = B.drop (fromIntegral i) s -isContiguous- :: (Eq a, Num a)- => [a] -> Bool+isContiguous :: (Eq a, Num a) => [a] -> Bool isContiguous [] = True isContiguous [_] = True isContiguous (x:y:rest)
src/Blockchain/VM/Opcodes.hs view
@@ -1,6 +1,6 @@ module Blockchain.VM.Opcodes where -import Prelude hiding (LT, GT, EQ)+import Prelude hiding (EQ, GT, LT) import Data.Binary import qualified Data.ByteString as B@@ -112,6 +112,7 @@ | CALLCODE | RETURN | DELEGATECALL+ | REVERT | INVALID | SUICIDE --Pseudo Opcodes@@ -274,6 +275,7 @@ 7 1 "Message-call into this account with an alternative account’s code, but persisting the current values for sender and value."+ , OPData 0xfd REVERT 0 0 "Stop execution and revert state changes (EIP140)." , OPData 0xfe INVALID 0 0 "Designated invalid instruction." , OPData 0xff
src/Legacy/Haskoin/V0102/Network/Haskoin/Crypto/BigWord.hs view
@@ -23,23 +23,23 @@ ) where import Control.DeepSeq (NFData, rnf)-import Control.Monad (unless, guard)+import Control.Monad (guard, unless) import Data.Aeson- (Value(String), FromJSON, ToJSON, parseJSON, toJSON, withText)+ (FromJSON, ToJSON, Value(String), parseJSON, toJSON, withText) import Data.Binary (Binary, get, put) import Data.Binary.Get- (getWord64be, getWord32be, getWord8, getByteString, Get)+ (Get, getByteString, getWord32be, getWord64be, getWord8) import Data.Binary.Put- (putWord64be, putWord32be, putWord8, putByteString)+ (putByteString, putWord32be, putWord64be, putWord8) -- Useful type aliases -- Data types -- Functions import Data.Bits- (Bits, (.&.), (.|.), xor, complement, shift, shiftL, shiftR, bit,- testBit, bitSize, popCount, isSigned)+ (Bits, (.&.), (.|.), bit, bitSize, complement, isSigned, popCount,+ shift, shiftL, shiftR, testBit, xor) import qualified Data.ByteString as BS (head, length, reverse)-import Data.Ratio (numerator, denominator)+import Data.Ratio (denominator, numerator) import qualified Data.Text as T (pack, unpack) import Legacy.Haskoin.V0102.Network.Haskoin.Crypto.Curve@@ -139,8 +139,7 @@ rFromInteger i = BigWord $ i `mod` curveN rBitSize _ = 256 -instance BigWordMod n =>- Num (BigWord n) where+instance BigWordMod n => Num (BigWord n) where fromInteger = rFromInteger (BigWord i1) + (BigWord i2) = fromInteger $ i1 + i2 (BigWord i1) * (BigWord i2) = fromInteger $ i1 * i2@@ -148,8 +147,7 @@ abs r = r signum (BigWord i) = fromInteger $ signum i -instance BigWordMod n =>- Bits (BigWord n) where+instance BigWordMod n => Bits (BigWord n) where (BigWord i1) .&. (BigWord i2) = fromInteger $ i1 .&. i2 (BigWord i1) .|. (BigWord i2) = fromInteger $ i1 .|. i2 (BigWord i1) `xor` (BigWord i2) = fromInteger $ i1 `xor` i2@@ -161,17 +159,14 @@ popCount (BigWord i) = popCount i isSigned _ = False -instance BigWordMod n =>- Bounded (BigWord n) where+instance BigWordMod n => Bounded (BigWord n) where minBound = 0 maxBound = fromInteger (-1) -instance BigWordMod n =>- Real (BigWord n) where+instance BigWordMod n => Real (BigWord n) where toRational (BigWord i) = toRational i -instance BigWordMod n =>- Enum (BigWord n) where+instance BigWordMod n => Enum (BigWord n) where succ r@(BigWord i) | r == maxBound = error "BigWord: tried to take succ of maxBound" | otherwise = fromInteger $ succ i@@ -184,18 +179,13 @@ | otherwise = error "BigWord: toEnum is outside of bounds" where r = fromInteger $ toEnum i- minFrom- :: BigWordMod a- => BigWord a -> BigWord a+ minFrom :: BigWordMod a => BigWord a -> BigWord a minFrom _ = minBound- maxFrom- :: BigWordMod a- => BigWord a -> BigWord a+ maxFrom :: BigWordMod a => BigWord a -> BigWord a maxFrom _ = maxBound fromEnum (BigWord i) = fromEnum i -instance BigWordMod n =>- Integral (BigWord n) where+instance BigWordMod n => Integral (BigWord n) where (BigWord i1) `quot` (BigWord i2) = fromInteger $ i1 `quot` i2 (BigWord i1) `rem` (BigWord i2) = fromInteger $ i1 `rem` i2 (BigWord i1) `div` (BigWord i2) = fromInteger $ i1 `div` i2
src/Legacy/Haskoin/V0102/Network/Haskoin/Util.hs view
@@ -28,9 +28,9 @@ import Numeric (readHex) -import Data.Binary (Binary, encode, decode, decodeOrFail)+import Data.Binary (Binary, decode, decodeOrFail, encode) import Data.Binary.Get- (Get, runGetOrFail, getByteString, ByteOffset, runGet)+ (ByteOffset, Get, getByteString, runGet, runGetOrFail) import Data.Binary.Put (Put, runPut) import Data.Bits ((.|.), shiftL, shiftR) import Data.List (unfoldr)@@ -95,21 +95,15 @@ -- Data.Binary helpers -- | Strict version of @Data.Binary.encode@-encode'- :: Binary a- => a -> BS.ByteString+encode' :: Binary a => a -> BS.ByteString encode' = toStrictBS . encode -- | Strict version of @Data.Binary.decode@-decode'- :: Binary a- => BS.ByteString -> a+decode' :: Binary a => BS.ByteString -> a decode' = decode . toLazyBS -- | Strict version of @Data.Binary.runGet@-runGet'- :: Binary a- => Get a -> BS.ByteString -> a+runGet' :: Binary a => Get a -> BS.ByteString -> a runGet' m = runGet m . toLazyBS -- | Strict version of @Data.Binary.runPut@@@ -117,8 +111,8 @@ runPut' = toStrictBS . runPut -- | Strict version of @Data.Binary.decodeOrFail@-decodeOrFail'- :: Binary a+decodeOrFail' ::+ Binary a => BS.ByteString -> Either (BS.ByteString, ByteOffset, String) (BS.ByteString, ByteOffset, a) decodeOrFail' bs =@@ -127,8 +121,8 @@ Right (lbs, o, res) -> Right (toStrictBS lbs, o, res) -- | Strict version of @Data.Binary.runGetOrFail@-runGetOrFail'- :: Binary a+runGetOrFail' ::+ Binary a => Get a -> BS.ByteString -> Either (BS.ByteString, ByteOffset, String) (BS.ByteString, ByteOffset, a)@@ -139,8 +133,8 @@ -- | Try to decode a Data.Binary value. If decoding succeeds, apply the function -- to the result. Otherwise, return the default value.-fromDecode- :: Binary a+fromDecode ::+ Binary a => BS.ByteString -- ^ The bytestring to decode -> b -- ^ Default value to return when decoding fails -> (a -> b) -- ^ Function to apply when decoding succeeds@@ -151,8 +145,8 @@ -- | Try to run a Data.Binary.Get monad. If decoding succeeds, apply a function -- to the result. Otherwise, return the default value.-fromRunGet- :: Binary a+fromRunGet ::+ Binary a => Get a -- ^ The Get monad to run -> BS.ByteString -- ^ The bytestring to decode -> b -- ^ Default value to return when decoding fails@@ -165,9 +159,7 @@ -- | Decode a Data.Binary value into the Either monad. A Right value is returned -- with the result upon success. Otherwise a Left value with the error message -- is returned.-decodeToEither- :: Binary a- => BS.ByteString -> Either String a+decodeToEither :: Binary a => BS.ByteString -> Either String a decodeToEither bs = case decodeOrFail' bs of Left (_, _, err) -> Left err@@ -175,18 +167,14 @@ -- | Decode a Data.Binary value into the Maybe monad. A Just value is returned -- with the result upon success. Otherwise, Nothing is returned.-decodeToMaybe- :: Binary a- => BS.ByteString -> Maybe a+decodeToMaybe :: Binary a => BS.ByteString -> Maybe a decodeToMaybe bs = fromDecode bs Nothing Just -- | Isolate a Data.Binary.Get monad for the next @Int@ bytes. Only the next -- @Int@ bytes of the input bytestring will be available for the Get monad to -- consume. This function will fail if the Get monad fails or some of the input -- is not consumed.-isolate- :: Binary a- => Int -> Get a -> Get a+isolate :: Binary a => Int -> Get a -> Get a isolate i g = do bs <- getByteString i case runGetOrFail' g bs of