From ce87ed5cbb3594d8e71be0063a482f16550d1055 Mon Sep 17 00:00:00 2001 From: Artur Cygan Date: Tue, 19 Apr 2022 19:24:47 +0200 Subject: [PATCH] Bump nixpkgs and hevm dependencies --- default.nix | 6 +++--- nix/solc-static.nix | 3 ++- src/hevm/hevm.cabal | 12 +++++------- src/hevm/src/EVM/Solidity.hs | 5 +++-- src/hevm/src/EVM/SymExec.hs | 4 ++-- src/hevm/src/EVM/Types.hs | 8 ++++---- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/default.nix b/default.nix index 02a69317f..7eebaf1d0 100644 --- a/default.nix +++ b/default.nix @@ -1,11 +1,11 @@ { system ? builtins.currentSystem , ... }: let - rev = "aa576357673d609e618d87db43210e49d4bb1789"; + rev = "bd4dffcdb7c577d74745bd1eff6230172bd176d5"; nixpkgs = builtins.fetchTarball { - name = "nixpkgs-release-21.05"; + name = "nixpkgs-unstable-2022-04-17"; url = "https://github.com/nixos/nixpkgs/tarball/${rev}"; - sha256 = "1868s3mp0lwg1jpxsgmgijzddr90bjkncf6k6zhdjqihf0i1n2np"; + sha256 = "18zacrykj2k5x42d0grr7g1y7xhy5ppq7j0gm3lrghwflyrdkslj"; }; in # Now return the Nixpkgs configured to use our overlay. diff --git a/nix/solc-static.nix b/nix/solc-static.nix index 8ea194ea3..461a3da22 100644 --- a/nix/solc-static.nix +++ b/nix/solc-static.nix @@ -40,7 +40,8 @@ stdenv.mkDerivation rec { sha256 = "${sha256}"; }; - nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; + nativeBuildInputs = [ makeWrapper ] + ++ lib.optional stdenv.isLinux autoPatchelfHook; postFixup = if (platform == "linux-amd64") then '' wrapProgram $out/bin/solc-${version} \ diff --git a/src/hevm/hevm.cabal b/src/hevm/hevm.cabal index cf36961e6..73f1a2176 100644 --- a/src/hevm/hevm.cabal +++ b/src/hevm/hevm.cabal @@ -70,7 +70,7 @@ library ghc-options: -Wall -Wno-deprecations extra-libraries: - secp256k1, ff + secp256k1, ff, c++ c-sources: ethjet/tinykeccak.c, ethjet/ethjet.c cxx-sources: @@ -88,7 +88,7 @@ library transformers >= 0.5.6 && < 0.6, tree-view >= 0.5 && < 0.6, abstract-par >= 0.3.3 && < 0.4, - aeson >= 1.5.6 && < 1.6, + aeson >= 2.0 && < 2.1, bytestring >= 0.10.8 && < 0.11, scientific >= 0.3.6 && < 0.4, binary >= 0.8.6 && < 0.9, @@ -97,7 +97,7 @@ library vector >= 0.12.1 && < 0.13, ansi-wl-pprint >= 0.6.9 && < 0.7, base16-bytestring >= 1.0.0 && < 2.0, - brick >= 0.58 && < 0.63, + brick >= 0.58 && < 0.69, megaparsec >= 9.0.0 && < 10.0, mtl >= 2.2.2 && < 2.3, directory >= 1.3.3 && < 1.4, @@ -105,13 +105,13 @@ library vty >= 5.25.1 && < 5.34, cereal >= 0.5.8 && < 0.6, cryptonite >= 0.27 && <= 0.29, - memory >= 0.14.18 && < 0.16, + memory >= 0.14.18 && < 0.20, data-dword >= 0.3.1 && < 0.4, fgl >= 5.7.0 && < 5.8, free >= 5.1.3 && < 5.2, haskeline >= 0.8.0 && < 0.9, process >= 1.6.5 && < 1.7, - lens >= 4.17.1 && < 4.20, + lens >= 4.17.1 && < 5.1, lens-aeson >= 1.0.2 && < 1.2, monad-par >= 0.3.5 && < 0.4, multiset >= 0.3.4 && < 0.4, @@ -124,7 +124,6 @@ library sbv >= 8.9, semver-range >= 0.2.7 && < 0.3, temporary >= 1.3 && < 1.4, - text-format >= 0.3.2 && < 0.4, witherable >= 0.3.5 && < 0.5, wreq >= 0.5.3 && < 0.6, regex-tdfa >= 1.2.3 && < 1.4, @@ -190,7 +189,6 @@ executable hevm sbv, temporary, text, - text-format, unordered-containers, vector, vty diff --git a/src/hevm/src/EVM/Solidity.hs b/src/hevm/src/EVM/Solidity.hs index b7d0f36bf..4e9d68929 100644 --- a/src/hevm/src/EVM/Solidity.hs +++ b/src/hevm/src/EVM/Solidity.hs @@ -70,6 +70,7 @@ import Control.Monad import Control.Lens hiding (Indexed, (.=)) import qualified Data.String.Here as Here import Data.Aeson hiding (json) +import qualified Data.Aeson.KeyMap as KeyMap import Data.Aeson.Types import Data.Aeson.Lens import Data.Scientific @@ -714,8 +715,8 @@ astIdMap = foldMap f f :: Value -> Map Int Value f (Array x) = foldMap f x f v@(Object x) = - let t = foldMap f (HMap.elems x) - in case HMap.lookup "id" x of + let t = foldMap f (KeyMap.elems x) + in case KeyMap.lookup "id" x of Nothing -> t Just (Number i) -> t <> Map.singleton (round i) v Just _ -> t diff --git a/src/hevm/src/EVM/SymExec.hs b/src/hevm/src/EVM/SymExec.hs index 5bbf1c03f..b828098e8 100644 --- a/src/hevm/src/EVM/SymExec.hs +++ b/src/hevm/src/EVM/SymExec.hs @@ -40,8 +40,8 @@ type EquivalenceResult = ProofResult ([VM], [VM]) VM () -- | Convenience functions for generating large symbolic byte strings sbytes32, sbytes128, sbytes256, sbytes512, sbytes1024 :: Query ([SWord 8]) -sbytes32 = toBytes <$> freshVar_ @ (WordN 256) -sbytes128 = toBytes <$> freshVar_ @ (WordN 1024) +sbytes32 = toBytes <$> freshVar_ @(WordN 256) +sbytes128 = toBytes <$> freshVar_ @(WordN 1024) sbytes256 = liftA2 (++) sbytes128 sbytes128 sbytes512 = liftA2 (++) sbytes256 sbytes256 sbytes1024 = liftA2 (++) sbytes512 sbytes512 diff --git a/src/hevm/src/EVM/Types.hs b/src/hevm/src/EVM/Types.hs index fdd2368de..1dc29e837 100644 --- a/src/hevm/src/EVM/Types.hs +++ b/src/hevm/src/EVM/Types.hs @@ -434,17 +434,17 @@ readN s = fromIntegral (read s :: Integer) readNull :: Read a => a -> String -> a readNull x = fromMaybe x . Text.Read.readMaybe -wordField :: JSON.Object -> Text -> JSON.Parser W256 +wordField :: JSON.Object -> Key -> JSON.Parser W256 wordField x f = ((readNull 0) . Text.unpack) <$> (x .: f) -addrField :: JSON.Object -> Text -> JSON.Parser Addr +addrField :: JSON.Object -> Key -> JSON.Parser Addr addrField x f = (read . Text.unpack) <$> (x .: f) -addrFieldMaybe :: JSON.Object -> Text -> JSON.Parser (Maybe Addr) +addrFieldMaybe :: JSON.Object -> Key -> JSON.Parser (Maybe Addr) addrFieldMaybe x f = (Text.Read.readMaybe . Text.unpack) <$> (x .: f) -dataField :: JSON.Object -> Text -> JSON.Parser ByteString +dataField :: JSON.Object -> Key -> JSON.Parser ByteString dataField x f = hexText <$> (x .: f) toWord512 :: W256 -> Word512