Make frequently modified fields strict (#1000)

arcz/rpc-cleanup
Artur Cygan 2 years ago committed by GitHub
parent 76efcc57a3
commit 206b911f65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      lib/Echidna/ABI.hs
  2. 14
      lib/Echidna/Types/Campaign.hs
  3. 8
      lib/Echidna/Types/Test.hs

@ -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
}

@ -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
}

@ -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

Loading…
Cancel
Save