diff --git a/lib/Echidna/Campaign.hs b/lib/Echidna/Campaign.hs index 6053f7c21..5c1b9597f 100644 --- a/lib/Echidna/Campaign.hs +++ b/lib/Echidna/Campaign.hs @@ -68,7 +68,9 @@ replayCorpus -> m () replayCorpus vm txSeqs = forM_ (zip [1..] txSeqs) $ \(i, (file, txSeq)) -> do - let maybeFaultyTx = List.find (\tx -> LitAddr tx.dst `notElem` Map.keys vm.env.contracts) txSeq + let maybeFaultyTx = + List.find (\tx -> LitAddr tx.dst `notElem` Map.keys vm.env.contracts) $ + List.filter (\case Tx { call = NoCall } -> False; _ -> True) txSeq case maybeFaultyTx of Nothing -> do _ <- callseq vm txSeq diff --git a/lib/Echidna/Exec.hs b/lib/Echidna/Exec.hs index d40398a77..9f91c3df5 100644 --- a/lib/Echidna/Exec.hs +++ b/lib/Echidna/Exec.hs @@ -87,11 +87,14 @@ execTxWith executeTx tx = do #traces .= emptyEvents vmBeforeTx <- get setupTx tx - gasLeftBeforeTx <- gets (.state.gas) - vmResult <- runFully - gasLeftAfterTx <- gets (.state.gas) - handleErrorsAndConstruction vmResult vmBeforeTx - pure (vmResult, gasLeftBeforeTx - gasLeftAfterTx) + case tx.call of + NoCall -> pure (VMSuccess (ConcreteBuf ""), 0) + _ -> do + gasLeftBeforeTx <- gets (.state.gas) + vmResult <- runFully + gasLeftAfterTx <- gets (.state.gas) + handleErrorsAndConstruction vmResult vmBeforeTx + pure (vmResult, gasLeftBeforeTx - gasLeftAfterTx) where runFully = do config <- asks (.cfg) diff --git a/lib/Echidna/Transaction.hs b/lib/Echidna/Transaction.hs index 3a5dc528e..d14a66e67 100644 --- a/lib/Echidna/Transaction.hs +++ b/lib/Echidna/Transaction.hs @@ -161,7 +161,6 @@ setupTx tx@Tx{call = NoCall} = fromEVM $ do { state = vm.state , block = advanceBlock vm.block tx.delay } - modify' $ execState $ loadContract (LitAddr tx.dst) setupTx tx@Tx{call} = fromEVM $ do resetState