Skip to content

Commit

Permalink
Don't execute NoCalls
Browse files Browse the repository at this point in the history
  • Loading branch information
arcz committed Feb 2, 2024
1 parent 8ecf7b9 commit 3205428
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 8 additions & 5 deletions lib/Echidna/Exec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion lib/Echidna/Transaction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3205428

Please sign in to comment.