Skip to content

Commit

Permalink
Docs improvement (#1278)
Browse files Browse the repository at this point in the history
* fix README.md

* fix Array.hs

* fix Corpus.hs

* fix Coverage.hs

* fix Solidity.hs

* fix Tx.hs

* fix Report.hs

* fix ABI.hs

* fix Campaign.hs

* fix Exec.hs

* fix Onchain.hs

---------

Co-authored-by: Emilio López <2642849+elopez@users.noreply.github.com>
  • Loading branch information
nnsW3 and elopez authored Jul 16, 2024
1 parent 6220064 commit 7fe4d40
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/container-linux-static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ This container is used as part of `.github/workflows/ci.yml` to produce
statically-linked amd64 linux builds of Echidna. It is based on the following
container produced by FP Complete and maintained in the
[`fpco/alpine-haskell-stack`](https://github.com/fpco/alpine-haskell-stack/tree/ghc927)
repository, and contains a few extra dependencies and configuration to make it
repository, and contains a few extra dependencies and configurations to make it
suitable for the GitHub Actions environment.
2 changes: 1 addition & 1 deletion lib/Echidna/ABI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ addChars c b = foldM withR b . enumFromTo 0 =<< rand where
addNulls :: MonadRandom m => ByteString -> m ByteString
addNulls = addChars $ pure 0

-- | Given a \"list-y\" structure with analogues of 'take', 'drop', and 'length',
-- | Given a \"list-y\" structure with analogs of 'take', 'drop', and 'length',
-- remove some elements at random.
shrinkWith
:: MonadRandom m
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Campaign.hs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ callseq vm txSeq = do

where
-- Given a list of transactions and a return typing rule, checks whether we
-- know the return type for each function called. If yes, tries to parse the
-- know the return type for each function called. If yes, try to parse the
-- return value as a value of that type. Returns a 'GenDict' style Map.
returnValues
:: [(Tx, VMResult Concrete RealWorld)]
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Exec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ execTxWith executeTx tx = do
fromEVM (continuation contract)
liftIO $ atomicWriteIORef cacheRef $ Map.insert addr (Just contract) cache
_ -> do
-- TODO: better error reporting in HEVM, when intermmittent
-- TODO: better error reporting in HEVM, when intermittent
-- network error then retry
liftIO $ atomicWriteIORef cacheRef $ Map.insert addr Nothing cache
logMsg $ "ERROR: Failed to fetch contract: " <> show q
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Mutator/Array.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ listMutators = fromList
-- | Mutate a list-like data structure using a list of mutators
mutateLL
:: (LL.ListLike f i, MonadRandom m)
-- | Required size for the mutated list-like value (or Nothing if there are no constrains)
-- | Required size for the mutated list-like value (or Nothing if there are no constraints)
=> Maybe Int
-- | Randomly generated list-like value to complement the mutated list, if it is
-- shorter than the requested size
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Onchain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ toFetchedContractData contract =
}

-- | Try to load the persisted RPC cache.
-- TODO: we use the corpus dir for now, think where to place it
-- TODO: we use the corpus dir for now, think about where to place it
loadRpcCache
:: EConfig
-> IO ( Map Addr (Maybe Contract)
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Output/Corpus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ saveCorpusEvent env (_time, campaignEvent) = do

getEventInfo = \case
-- TODO: We save intermediate reproducers in separate directories.
-- This is to because there can be a lot of them and we want to skip
-- This is because there can be a lot of them and we want to skip
-- loading those on startup. Ideally, we should override the same file
-- with a better version of a reproducer, this is smaller or more optimized.
TestFalsified test -> Just ("reproducers-unshrunk", test.reproducer)
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Types/Coverage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type TxResults = Word64

-- | Given good point coverage, count the number of unique points but
-- only considering the different instruction PCs (discarding the TxResult).
-- This is useful to report a coverage measure to the user
-- This is useful for reporting a coverage measure to the user
scoveragePoints :: CoverageMap -> IO Int
scoveragePoints cm = do
sum <$> mapM (V.foldl' countCovered 0) (Map.elems cm)
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Types/Solidity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ instance Show SolException where
ConstructorArgs s -> "Constructor arguments are required: " ++ s
NoCryticCompile -> "crytic-compile not installed or not found in PATH. To install it, run:\n pip install crytic-compile"
InvalidMethodFilters f -> "Applying the filter " ++ show f ++ " to the methods produces an empty list. Are you filtering the correct functions using `filterFunctions` or fuzzing the correct contract?"
SetUpCallFailed -> "Calling the setUp() function failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.)"
SetUpCallFailed -> "Calling the setUp() function failed (revert, out-of-gas, sending ether to a non-payable constructor, etc.)"
DeploymentFailed a t -> "Deploying the contract " ++ show a ++ " failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.):\n" ++ unpack t
OutdatedSolcVersion v -> "Solc version " ++ toString v ++ " detected. Echidna doesn't support versions of solc before " ++ toString minSupportedSolcVersion ++ ". Please use a newer version."

Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/Types/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ catNoCalls (tx1:tx2:xs) =
_ -> tx1 : catNoCalls (tx2:xs)
where nc = tx1 { delay = (fst tx1.delay + fst tx2.delay, snd tx1.delay + snd tx2.delay) }

-- | Transform a VMResult into a more hash friendly sum type
-- | Transform a VMResult into a more hash-friendly sum type
getResult :: VMResult Concrete s -> TxResult
getResult = \case
VMSuccess b | forceBuf b == encodeAbiValue (AbiBool True) -> ReturnTrue
Expand Down
2 changes: 1 addition & 1 deletion lib/Echidna/UI/Report.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ppCampaign vm workerStates = do
, seedPrinted
]

-- | Given rules for pretty-printing associated address, and whether to print
-- | Given rules for pretty-printing associated addresses, and whether to print
-- them, pretty-print a 'Transaction'.
ppTx :: MonadReader Env m => VM Concrete RealWorld -> Bool -> Tx -> m String
ppTx _ _ Tx { call = NoCall, delay } =
Expand Down

0 comments on commit 7fe4d40

Please sign in to comment.