eth/tracers/logger: rename WriteTo to Write (#33227)
Some checks are pending
/ Windows Build (push) Waiting to run
/ Docker Image (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run

This commit is contained in:
David Klank 2025-11-27 10:05:24 +02:00 committed by GitHub
parent 9bab01bee4
commit 6426257c0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,8 +94,8 @@ func (s *StructLog) ErrorString() string {
return "" return ""
} }
// WriteTo writes the human-readable log data into the supplied writer. // Write writes the human-readable log data into the supplied writer.
func (s *StructLog) WriteTo(writer io.Writer) { func (s *StructLog) Write(writer io.Writer) {
fmt.Fprintf(writer, "%-16spc=%08d gas=%v cost=%v", s.Op, s.Pc, s.Gas, s.GasCost) fmt.Fprintf(writer, "%-16spc=%08d gas=%v cost=%v", s.Op, s.Pc, s.Gas, s.GasCost)
if s.Err != nil { if s.Err != nil {
fmt.Fprintf(writer, " ERROR: %v", s.Err) fmt.Fprintf(writer, " ERROR: %v", s.Err)
@ -324,7 +324,7 @@ func (l *StructLogger) OnOpcode(pc uint64, opcode byte, gas, cost uint64, scope
l.logs = append(l.logs, entry) l.logs = append(l.logs, entry)
return return
} }
log.WriteTo(l.writer) log.Write(l.writer)
} }
// OnExit is called a call frame finishes processing. // OnExit is called a call frame finishes processing.
@ -405,7 +405,7 @@ func (l *StructLogger) Output() []byte { return l.output }
// @deprecated // @deprecated
func WriteTrace(writer io.Writer, logs []StructLog) { func WriteTrace(writer io.Writer, logs []StructLog) {
for _, log := range logs { for _, log := range logs {
log.WriteTo(writer) log.Write(writer)
} }
} }