Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix replayCorpus function #1035

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/Echidna/Campaign.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Echidna.Campaign where
import Optics.Core

import Control.DeepSeq (force)
import Control.Monad (foldM, replicateM, when, unless, void)
import Control.Monad (replicateM, when, unless, void)
import Control.Monad.Catch (MonadCatch(..), MonadThrow(..))
import Control.Monad.Random.Strict (MonadRandom, RandT, evalRandT)
import Control.Monad.Reader (MonadReader, asks, liftIO, ask)
Expand Down Expand Up @@ -82,10 +82,10 @@ isSuccessful Campaign{tests} =
-- contain minized corpus without sequences that didn't increase the coverage.
replayCorpus
:: (MonadIO m, MonadCatch m, MonadRandom m, MonadReader Env m, MonadState Campaign m)
=> VM -- ^ VM to start replaying from
-> [[Tx]] -- ^ corpus to replay
-> m VM -- ^ VM after corpus replay
replayCorpus = foldM callseq
=> VM -- ^ Initial VM state
-> [[Tx]] -- ^ Corpus to replay
-> m ()
replayCorpus vm = mapM_ (callseq vm)

-- | Run a fuzzing campaign given an initial universe state, some tests, and an
-- optional dictionary to generate calls with. Return the 'Campaign' state once
Expand Down