Skip to content

Commit

Permalink
echidna: fix build due to brick-1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
hellwolf committed Aug 28, 2023
1 parent 6a1113b commit b0d8ef7
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
44 changes: 44 additions & 0 deletions pkgs/tools/security/echidna/brick-1.9.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/lib/Echidna/UI.hs b/lib/Echidna/UI.hs
index 613c3ef..559e227 100644
--- a/lib/Echidna/UI.hs
+++ b/lib/Echidna/UI.hs
@@ -131,7 +131,7 @@ ui vm world dict initialCorpus = do
, now = now
, fetchedContracts = mempty
, fetchedSlots = mempty
- , fetchedDialog = B.dialog (Just " Fetched contracts/slots ") Nothing 80
+ , fetchedDialog = B.dialog (Just $ str " Fetched contracts/slots ") Nothing 80
, displayFetchedDialog = False
, workerEvents = mempty
, corpusSize = 0
diff --git a/lib/Echidna/UI/Widgets.hs b/lib/Echidna/UI/Widgets.hs
index 4eee4ce..964b314 100644
--- a/lib/Echidna/UI/Widgets.hs
+++ b/lib/Echidna/UI/Widgets.hs
@@ -4,7 +4,7 @@ module Echidna.UI.Widgets where

#ifdef INTERACTIVE_UI

-import Brick
+import Brick hiding (style)
import Brick.AttrMap qualified as A
import Brick.Widgets.Border
import Brick.Widgets.Center
@@ -43,7 +43,7 @@ data UIState = UIState
, now :: LocalTime
, fetchedContracts :: Map Addr (Maybe Contract)
, fetchedSlots :: Map Addr (Map W256 (Maybe W256))
- , fetchedDialog :: B.Dialog ()
+ , fetchedDialog :: B.Dialog () Name
, displayFetchedDialog :: Bool

, workerEvents :: Seq (Int, LocalTime, CampaignEvent)
@@ -222,7 +222,7 @@ perfWidget uiState =
ppSeed :: [WorkerState] -> String
ppSeed campaigns = show (head campaigns).genDict.defSeed

-fetchedDialogWidget :: UIState -> Widget n
+fetchedDialogWidget :: UIState -> Widget Name
fetchedDialogWidget uiState =
B.renderDialog uiState.fetchedDialog $ padLeftRight 1 $
foldl (<=>) emptyWidget (Map.mapWithKey renderContract uiState.fetchedContracts)
3 changes: 3 additions & 0 deletions pkgs/tools/security/echidna/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ in mkDerivation rec {
sha256 = "sha256-5d9ttPR3rRHywBeLM85EGCEZLNZNZzOAhIN6AJToJyI=";
};

# Note: pending PR https://github.com/crytic/echidna/pull/1096
patches = [ ./brick-1.9.patch ];

isLibrary = true;
isExecutable = true;

Expand Down

0 comments on commit b0d8ef7

Please sign in to comment.