Skip to content

Commit 9f9768b

Browse files
committed
cleaning up some comments
1 parent c7cf2a1 commit 9f9768b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

fuzzing/corpus/corpus.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ type Corpus struct {
6969
logger *logging.Logger
7070
}
7171

72+
// NewCorpus initializes a new Corpus object, reading artifacts from the provided directory. If the directory refers
73+
// to an empty path, artifacts will not be persistently stored.
7274
func NewCorpus(corpusDirectory string) (*Corpus, error) {
7375
var err error
7476
corpus := &Corpus{
@@ -185,8 +187,8 @@ func (c *Corpus) migrateLegacyCorpus() error {
185187

186188
// Initialize initializes the in-memory corpus state but does not actually replay any of the sequences stored in the corpus.
187189
// It seeds coverage information from the post-setup chain while enqueueing all persisted sequences for execution. The fuzzer workers
188-
// will concurrently all the sequences stored in the corpus and then the onComplete hook is invoked to notify the fuzzer that the corpus has been initialized.
189-
// Returns an error if seeding fails.
190+
// will concurrently execute all the sequences stored in the corpus and then the onComplete hook is invoked to notify the fuzzer that
191+
// the corpus has been initialized. Returns an error if seeding fails.
190192
func (c *Corpus) Initialize(baseTestChain *chain.TestChain, contractDefinitions contracts.Contracts, onComplete func(active uint64, total uint64)) error {
191193
// Acquire our call sequences lock during the duration of this method.
192194
c.callSequencesLock.Lock()
@@ -226,7 +228,7 @@ func (c *Corpus) Initialize(baseTestChain *chain.TestChain, contractDefinitions
226228
return nil
227229
})
228230
if err != nil {
229-
return fmt.Errorf("failed to seed coverage maps during warmup preparation: %v", err)
231+
return fmt.Errorf("failed to initialize coverage maps, base test chain cloning encountered error: %v", err)
230232
}
231233
defer testChain.Close()
232234

0 commit comments

Comments
 (0)