Skip to content

Commit 955a64a

Browse files
more fixes
1 parent e69885f commit 955a64a

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

lib/Echidna/Agent/Fuzzer.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import Control.Monad.Trans (lift)
1616
import Control.Monad.IO.Class (MonadIO)
1717
import System.Random (mkStdGen)
1818
import Data.IORef (IORef, writeIORef, readIORef, atomicModifyIORef')
19-
import Data.Text (Text)
20-
import EVM.ABI (AbiValue)
2119
import Data.Map (Map)
2220
import qualified Data.Map as Map
2321
import System.Directory (getCurrentDirectory)
@@ -198,7 +196,7 @@ fuzzerLoop callback vm testLimit bus = do
198196
void $ saveLcovHook env dir env.sourceCache contracts
199197
putStrLn $ "Fuzzer " ++ show workerId ++ ": dumped LCOV coverage."
200198
pure ()
201-
Just (WrappedMessage _ (ToFuzzer tid (PrioritizeFunction funcName))) -> do
199+
Just (WrappedMessage _ (ToFuzzer _ (PrioritizeFunction _))) -> do
202200
-- Deprecated
203201
pure ()
204202
Just (WrappedMessage _ (ToFuzzer tid (FuzzTransaction funcName args))) -> do

lib/Echidna/MCP.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
module Echidna.MCP where
55

66
import Control.Concurrent (forkIO)
7-
import Control.Monad (forever, when)
7+
import Control.Monad (forever, unless)
88
import Control.Concurrent.STM
9-
import Data.IORef (readIORef, writeIORef, modifyIORef', newIORef, IORef)
9+
import Data.IORef (readIORef, modifyIORef', newIORef, IORef)
1010
import Data.List (find, isPrefixOf)
1111
import qualified Data.Maybe
1212
import qualified Data.Set as Set
@@ -72,7 +72,7 @@ statusTool workerRefs statusRef _ env _ _ = do
7272

7373
let timeStr = case st.lastCoverageTime of
7474
Nothing -> "Never"
75-
Just t -> show (round $ diffUTCTime now t)
75+
Just t -> show (round (diffUTCTime now t) :: Integer)
7676

7777
funcs = if null st.coveredFunctions
7878
then "None"
@@ -240,7 +240,7 @@ readLogsTool _ _ _ logsRef = do
240240
-- logs is [Newest, ..., Oldest]
241241
-- We want to take the 100 newest, and show them in chronological order
242242
let logsToShow = reverse $ take 100 logs
243-
return $ unpack $ T.unlines $ logsToShow
243+
return $ unpack $ T.unlines logsToShow
244244

245245
-- | Implementation of show_coverage tool
246246
showCoverageTool :: ToolExecution
@@ -310,7 +310,7 @@ runMCPServer env workerRefs port logsRef = do
310310
msg <- atomically $ readTChan myBus
311311
case msg of
312312
WrappedMessage _ (Broadcast (NewCoverageInfo _ txs isReplaying)) -> do
313-
when (not isReplaying) $ do
313+
unless isReplaying $ do
314314
now <- getCurrentTime
315315
let funcNames = map getFunctionName txs
316316
lastFunc = if null funcNames then "unknown" else last funcNames

0 commit comments

Comments
 (0)