Skip to content

Commit 08aa8cb

Browse files
Merge remote-tracking branch 'origin/master' into dev-test-refactoring
2 parents 1bdb5bd + b425931 commit 08aa8cb

File tree

4 files changed

+31
-64
lines changed

4 files changed

+31
-64
lines changed

default.nix

Lines changed: 28 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
11
{ pkgs ? import (builtins.fetchTarball {
2-
name = "nixpkgs-unstable";
3-
url = "https://github.com/nixos/nixpkgs/archive/fb45fa64ae3460d6bd2701ab5a6c4512d781f166.tar.gz";
4-
sha256 = "sha256:1dcvpwshmalp5xp25z9pjm8svlnfgkcrbhany1pwjwwcpxm5kp40";
2+
name = "nixpkgs-unstable-2021-10-15";
3+
url = "https://github.com/nixos/nixpkgs/archive/ee084c02040e864eeeb4cf4f8538d92f7c675671.tar.gz";
4+
sha256 = "sha256:1x8amcixdaw3ryyia32pb706vzhvn5whq9n8jin0qcha5qnm1fnh";
55
}) {}
66
}:
77

88
let
9-
dapptools = pkgs.fetchFromGitHub {
10-
owner = "dapphub";
11-
repo = "dapptools";
12-
rev = "hevm/0.47.0";
13-
sha256 = "sha256-gFePasNQJ9bxrCDsSHWsZj2JVkjhVwIkjZf+wPDBKo0=";
14-
};
15-
hevm = pkgs.haskell.lib.dontCheck (
16-
pkgs.haskell.lib.doJailbreak (
17-
pkgs.haskellPackages.callCabal2nix "hevm" "${dapptools}/src/hevm"
18-
{ secp256k1 = pkgs.secp256k1; }
19-
));
20-
21-
crytic-compile = pkgs.python3Packages.callPackage (import ./nix/crytic-compile.nix) { };
22-
# slither is shipped with solc by default, we don't use it as we need
23-
# precise solc versions
24-
slither-analyzer = pkgs.slither-analyzer.override {
25-
inherit crytic-compile;
26-
withSolc = false;
27-
};
28-
299
# this is not perfect for development as it hardcodes solc to 0.5.7, test suite runs fine though
3010
# would be great to integrate solc-select to be more flexible, improve this in future
3111
solc = pkgs.stdenv.mkDerivation {
@@ -48,17 +28,17 @@ let
4828
'';
4929
};
5030

31+
slither-analyzer = pkgs.slither-analyzer.override { withSolc = false; };
32+
5133
v = "1.7.2";
5234

53-
f = { mkDerivation, aeson, ansi-terminal, base, base16-bytestring
54-
, binary, brick, bytestring, cborg, containers, data-dword, data-has
55-
, deepseq, directory, exceptions, filepath, hashable, hevm, hpack
56-
, lens, lens-aeson, megaparsec, MonadRandom, mtl
57-
, optparse-applicative, process, random, stm, tasty
58-
, tasty-hunit, tasty-quickcheck, temporary, text, transformers
59-
, unix, unliftio, unliftio-core, unordered-containers, vector
60-
, vector-instances, vty, wl-pprint-annotated, word8, yaml
61-
, cabal-install, extra, ListLike, hlint, semver, haskell-language-server
35+
f = { mkDerivation, aeson, ansi-terminal, base, base16-bytestring, binary
36+
, brick, bytestring, cborg, containers, data-dword, data-has, deepseq
37+
, directory, exceptions, filepath, hashable, hevm, hpack, lens, lens-aeson
38+
, megaparsec, MonadRandom, mtl, optparse-applicative, process, random
39+
, semver, stm, tasty, tasty-hunit, tasty-quickcheck, temporary, text
40+
, transformers, unix, unliftio, unliftio-core, unordered-containers, vector
41+
, vector-instances, vty, wl-pprint-annotated, word8, yaml, extra, ListLike
6242
}:
6343
mkDerivation rec {
6444
pname = "echidna";
@@ -68,18 +48,17 @@ let
6848
isExecutable = true;
6949
libraryHaskellDepends = [
7050
aeson ansi-terminal base base16-bytestring binary brick bytestring
71-
cborg containers data-dword data-has deepseq directory exceptions filepath
72-
hashable hevm lens lens-aeson megaparsec MonadRandom mtl
51+
cborg containers data-dword data-has deepseq directory exceptions
52+
filepath hashable hevm lens lens-aeson megaparsec MonadRandom mtl
7353
optparse-applicative process random stm temporary text transformers
7454
unix unliftio unliftio-core unordered-containers vector
7555
vector-instances vty wl-pprint-annotated word8 yaml extra ListLike
7656
semver
7757
] ++ (if pkgs.lib.inNixShell then testHaskellDepends else []);
78-
libraryToolDepends = [ hpack cabal-install hlint slither-analyzer solc haskell-language-server ];
7958
executableHaskellDepends = libraryHaskellDepends;
80-
testHaskellDepends = [
81-
tasty tasty-hunit tasty-quickcheck
82-
];
59+
testHaskellDepends = [ tasty tasty-hunit tasty-quickcheck ];
60+
libraryToolDepends = [ hpack ];
61+
testToolDepends = [ slither-analyzer solc ];
8362
preConfigure = ''
8463
hpack
8564
# re-enable dynamic build for Linux
@@ -91,8 +70,16 @@ let
9170
doCheck = true;
9271
};
9372

94-
drv = pkgs.haskellPackages.callPackage f { hevm = hevm; };
73+
echidna = pkgs.haskellPackages.callPackage f { };
74+
echidnaShell = pkgs.haskellPackages.shellFor {
75+
packages = p: [ echidna ];
76+
buildInputs = with pkgs.haskellPackages; [
77+
hlint
78+
cabal-install
79+
haskell-language-server
80+
];
81+
};
9582
in
9683
if pkgs.lib.inNixShell
97-
then drv.env
98-
else pkgs.haskell.lib.justStaticExecutables drv
84+
then echidnaShell
85+
else pkgs.haskell.lib.justStaticExecutables echidna

lib/Echidna/Types/Tx.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ data TxResult = ReturnTrue
102102
| ErrorStackUnderrun
103103
| ErrorBadJumpDestination
104104
| ErrorRevert
105-
| ErrorNoSuchContract
106105
| ErrorOutOfGas
107106
| ErrorBadCheatCode
108107
| ErrorStackLimitExceeded
109108
| ErrorIllegalOverflow
110109
| ErrorQuery
111110
| ErrorStateChangeWhileStatic
111+
| ErrorInvalidFormat
112112
| ErrorInvalidMemoryAccess
113113
| ErrorCallDepthLimitReached
114114
| ErrorMaxCodeSizeExceeded
@@ -148,13 +148,13 @@ getResult (VMFailure SelfDestruction ) = ErrorSelfDestruction
148148
getResult (VMFailure StackUnderrun ) = ErrorStackUnderrun
149149
getResult (VMFailure BadJumpDestination ) = ErrorBadJumpDestination
150150
getResult (VMFailure (Revert _)) = ErrorRevert
151-
getResult (VMFailure (NoSuchContract _)) = ErrorNoSuchContract
152151
getResult (VMFailure (OutOfGas _ _)) = ErrorOutOfGas
153152
getResult (VMFailure (BadCheatCode _)) = ErrorBadCheatCode
154153
getResult (VMFailure StackLimitExceeded) = ErrorStackLimitExceeded
155154
getResult (VMFailure IllegalOverflow) = ErrorIllegalOverflow
156155
getResult (VMFailure (Query _)) = ErrorQuery
157156
getResult (VMFailure StateChangeWhileStatic) = ErrorStateChangeWhileStatic
157+
getResult (VMFailure InvalidFormat) = ErrorInvalidFormat
158158
getResult (VMFailure InvalidMemoryAccess) = ErrorInvalidMemoryAccess
159159
getResult (VMFailure CallDepthLimitReached) = ErrorCallDepthLimitReached
160160
getResult (VMFailure (MaxCodeSizeExceeded _ _)) = ErrorMaxCodeSizeExceeded

nix/crytic-compile.nix

Lines changed: 0 additions & 20 deletions
This file was deleted.

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ packages:
55

66
extra-deps:
77
- git: https://github.com/dapphub/dapptools.git
8-
commit: 4fe19a0ff493f09de58c13c54cb69d962dd10b82
8+
commit: a2b96cc2dbc28508c9fe699d6438bf6eccafc2ad
99
subdirs:
1010
- src/hevm
1111

0 commit comments

Comments
 (0)