Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/hevm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Correctly handle concrete returndata when checking the result of a symbolic test
- Correctly handle reverting branches when checking the result of a symbolic test

## [0.49.0] - 2021-11-12

Expand Down
8 changes: 6 additions & 2 deletions src/hevm/src/EVM/UnitTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -770,10 +770,14 @@ execSymTest opts@UnitTestOptions{ .. } method cd = do
Stepper.runFully >>= \vm' -> case view result vm' of
Just (VMFailure err) ->
-- If we failed, put the error in the trace.
Stepper.evm (pushTrace (ErrorTrace err)) >> (pure (True, vm'))
Stepper.evm (pushTrace (ErrorTrace err)) >> pure (True, vm')
Just (VMSuccess _) -> do
postVm <- checkSymFailures opts
pure (False, postVm)
-- calls to failed() contain reverting branches since https://github.com/dapphub/ds-test/pull/30
case view result postVm of
Just (VMSuccess _) -> pure (False, postVm)
Just (VMFailure _) -> pure (True, postVm)
r -> error $ "unexpected return value after call to failed(): " ++ show r
Nothing -> error "Internal Error: execSymTest: vm has not completed execution!"

checkSymFailures :: UnitTestOptions -> Stepper VM
Expand Down