eth/tracers/logger: fix nit re empty lists vs nil

This commit is contained in:
Martin Holst Swende 2024-11-26 18:28:53 +01:00
parent 8ebb222227
commit 2b0c1f42fe
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -222,6 +222,7 @@ func NewStreamingStructLogger(cfg *Config, writer io.Writer) *StructLogger {
func NewStructLogger(cfg *Config) *StructLogger {
logger := &StructLogger{
storage: make(map[common.Address]Storage),
logs: make([]json.RawMessage, 0),
}
if cfg != nil {
logger.cfg = *cfg
@ -238,14 +239,6 @@ func (l *StructLogger) Hooks() *tracing.Hooks {
}
}
// Reset clears the data held by the logger.
func (l *StructLogger) Reset() {
l.storage = make(map[common.Address]Storage)
l.output = make([]byte, 0)
l.logs = l.logs[:0]
l.err = nil
}
// OnOpcode logs a new structured log message and pushes it out to the environment
//
// OnOpcode also tracks SLOAD/SSTORE ops to track storage change.