Skip to content
Open
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
7 changes: 3 additions & 4 deletions fuzzing/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"math/big"
"os"
"slices"
"strconv"
"strings"

Expand Down Expand Up @@ -255,10 +256,8 @@ func (testCfg *TestingConfig) Validate() error {

// Validate that prefixes do not overlap
for _, prefix := range testCfg.PropertyTesting.TestPrefixes {
for _, prefix2 := range testCfg.OptimizationTesting.TestPrefixes {
if prefix == prefix2 {
return errors.New("project configuration must specify unique test name prefixes for property and optimization testing")
}
if slices.Contains(testCfg.OptimizationTesting.TestPrefixes, prefix) {
return errors.New("project configuration must specify unique test name prefixes for property and optimization testing")
}
}

Expand Down
9 changes: 4 additions & 5 deletions logging/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/crytic/medusa/logging/colors"
"github.com/rs/zerolog"
"io"
"slices"
"strings"
)

Expand Down Expand Up @@ -103,11 +104,9 @@ func (l *Logger) NewSubLogger(key string, value string) *Logger {
func (l *Logger) AddWriter(writer io.Writer, format LogFormat, colored bool) {
// First, try to add the writer to the list of channels that want structured logs
if format == STRUCTURED {
for _, w := range l.structuredWriters {
if w == writer {
// Writer already exists, return
return
}
if slices.Contains(l.structuredWriters, writer) {
// Writer already exists, return
return
}
// Add the writer and recreate the logger
l.structuredWriters = append(l.structuredWriters, writer)
Expand Down