Skip to content

Commit

Permalink
Merge pull request dapphub#786 from dapphub/fix-dapp-replay
Browse files Browse the repository at this point in the history
hevm: no whitespace in invariant replay data
  • Loading branch information
d-xo authored Sep 15, 2021
2 parents 37c3d59 + 7993963 commit 728a924
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/dapp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Dapp remappings ignores non-directories in `DAPP_LIB`

### Fixed

- Dapp can correctly parse replay strings from invariant tests

## [0.34.1] - 2021-09-08

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/dapp/libexec/dapp/dapp---hevm-opts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ opts=()
[[ "$DAPP_TEST_CACHE" ]] && opts+=(--cache "$DAPP_TEST_CACHE")
[[ "$DAPP_TEST_MATCH" ]] && opts+=(--match "$DAPP_TEST_MATCH")
[[ "$DAPP_TEST_SOLVER" ]] && opts+=(--solver "$DAPP_TEST_SOLVER")
[[ "$DAPP_TEST_REPLAY" ]] && opts+=(--replay \'"$DAPP_TEST_REPLAY"\')
[[ "$DAPP_TEST_REPLAY" ]] && opts+=(--replay "$DAPP_TEST_REPLAY")
[[ "$DAPP_TEST_VERBOSITY" ]] && opts+=(--verbose "$DAPP_TEST_VERBOSITY")
[[ "$DAPP_TEST_COV_MATCH" ]] && opts+=(--cov-match "$DAPP_TEST_COV_MATCH")
[[ "$DAPP_TEST_FUZZ_RUNS" ]] && opts+=(--fuzz-runs "$DAPP_TEST_FUZZ_RUNS")
Expand Down
8 changes: 7 additions & 1 deletion src/hevm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# hevm changelog

## Unreleased

## Fixed

- Test contracts with no code (e.g. `abstract` contracts) are now skipped
- Replay data for invariant tests is now displayed in a form that does not cause errors when used with `dapp test --replay`

## [0.48.1] - 2021-09-08

### Added
Expand All @@ -14,7 +21,6 @@
### Fixed

- The block gas limit and basefee are now correctly fetched when running tests via rpc
- Test contracts with no code (e.g. `abstract` contracts) are now skipped

## 0.48.0 - 2021-08-03

Expand Down
2 changes: 1 addition & 1 deletion src/hevm/src/EVM/UnitTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ exploreRun opts@UnitTestOptions{..} initialVm testName replayTxs = do
then return ("\x1b[32m[PASS]\x1b[0m " <> testName <> " (runs: " <> (pack $ show fuzzRuns) <>", depth: " <> pack (show depth) <> ")",
Right (passOutput vm' opts testName), vm') -- no canonical "post vm"
else let replayText = if null replayTxs
then "\nReplay data: '(" <> pack (show testName) <> ", " <> pack (show (show (ByteStringS $ rlpencode counterex))) <> ")'"
then "\nReplay data: '(" <> pack (show testName) <> "," <> pack (show (show (ByteStringS $ rlpencode counterex))) <> ")'"
else " (replayed)"
in return ("\x1b[31m[FAIL]\x1b[0m " <> testName <> replayText, Left (failOutput vm' opts testName), vm')

Expand Down

0 comments on commit 728a924

Please sign in to comment.