Skip to content

Commit e68f64d

Browse files
committed
eth/tracers: make enter/exit/step optional
1 parent 91e05c3 commit e68f64d

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

eth/tracers/tracer.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -553,17 +553,10 @@ func New(code string, ctx *Context) (*Tracer, error) {
553553
tracer.vm.Pop()
554554
hasExit := tracer.vm.GetPropString(tracer.tracerObject, "exit")
555555
tracer.vm.Pop()
556-
557556
if hasEnter != hasExit {
558557
return nil, fmt.Errorf("trace object must expose either both or none of enter() and exit()")
559558
}
560-
if !hasStep {
561-
// If there's no step function, the enter and exit must be present
562-
if !hasEnter {
563-
return nil, fmt.Errorf("trace object must expose either step() or both enter() and exit()")
564-
}
565-
}
566-
tracer.traceCallFrames = hasEnter
559+
tracer.traceCallFrames = hasEnter && hasExit
567560
tracer.traceSteps = hasStep
568561

569562
// Tracer is valid, inject the big int library to access large numbers

0 commit comments

Comments
 (0)