Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make frequently modified fields strict #1000

Merged
merged 1 commit into from
Mar 27, 2023
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
6 changes: 3 additions & 3 deletions lib/Echidna/ABI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ hashSig = abiKeccak . TE.encodeUtf8
data GenDict = GenDict
{ pSynthA :: Float
-- ^ Fraction of time to use dictionary vs. synthesize
, constants :: HashMap AbiType (Set AbiValue)
, constants :: !(HashMap AbiType (Set AbiValue))
-- ^ Constants to use, sorted by type
, wholeCalls :: HashMap SolSignature (Set SolCall)
, wholeCalls :: !(HashMap SolSignature (Set SolCall))
-- ^ Whole calls to use, sorted by type
, defSeed :: Int
-- ^ Default seed to use if one is not provided in EConfig
, rTypes :: Text -> Maybe AbiType
-- ^ Return types of any methods we scrape return values from
, dictValues :: Set W256
, dictValues :: !(Set W256)
-- ^ A set of int/uint constants for better performance
}

Expand Down
14 changes: 7 additions & 7 deletions lib/Echidna/Types/Campaign.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ data CampaignConf = CampaignConf

-- | The state of a fuzzing campaign.
data Campaign = Campaign
{ tests :: [EchidnaTest]
{ tests :: ![EchidnaTest]
-- ^ Tests being evaluated
, coverage :: CoverageMap
, coverage :: !CoverageMap
-- ^ Coverage captured (NOTE: we don't always record this)
, gasInfo :: Map Text (Gas, [Tx])
, gasInfo :: !(Map Text (Gas, [Tx]))
-- ^ Worst case gas (NOTE: we don't always record this)
, genDict :: GenDict
, genDict :: !GenDict
-- ^ Generation dictionary
, newCoverage :: Bool
, newCoverage :: !Bool
-- ^ Flag to indicate new coverage found
, corpus :: Corpus
, corpus :: !Corpus
-- ^ List of transactions with maximum coverage
, ncallseqs :: Int
, ncallseqs :: !Int
-- ^ Number of times the callseq is called
}

Expand Down
8 changes: 4 additions & 4 deletions lib/Echidna/Types/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ data TestConf = TestConf
-- | State of a particular Echidna test. N.B.: 'Solved' means a falsifying
-- call sequence was found.
data TestState
= Open Int -- ^ Maybe solvable, tracking attempts already made
| Large Int -- ^ Solved, maybe shrinable, tracking shrinks tried
| Passed -- ^ Presumed unsolvable
| Solved -- ^ Solved with no need for shrinking
= Open !Int -- ^ Maybe solvable, tracking attempts already made
| Large !Int -- ^ Solved, maybe shrinable, tracking shrinks tried
| Passed -- ^ Presumed unsolvable
| Solved -- ^ Solved with no need for shrinking
| Failed ExecException -- ^ Broke the execution environment
deriving Show

Expand Down