Skip to content

Commit

Permalink
minor styling
Browse files Browse the repository at this point in the history
  • Loading branch information
s1na committed Feb 14, 2023
1 parent 384facf commit 584c4c0
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions eth/tracers/native/call_flat.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,19 @@ func (t *flatCallTracer) CaptureExit(output []byte, gasUsed uint64, err error) {

// Parity traces don't include CALL/STATICCALLs to precompiles.
// By default we remove them from the callstack.
excludePrecompileCalls := !t.config.IncludePrecompiles
if excludePrecompileCalls {
var (
// call has been nested in parent
parent = t.tracer.callstack[len(t.tracer.callstack)-1]
call = parent.Calls[len(parent.Calls)-1]
typ = call.Type
to = call.To
)
if typ == vm.CALL || typ == vm.STATICCALL {
if t.isPrecompiled(to) {
t.tracer.callstack[len(t.tracer.callstack)-1].Calls = parent.Calls[:len(parent.Calls)-1]
}
if t.config.IncludePrecompiles {
return
}
var (
// call has been nested in parent
parent = t.tracer.callstack[len(t.tracer.callstack)-1]
call = parent.Calls[len(parent.Calls)-1]
typ = call.Type
to = call.To
)
if typ == vm.CALL || typ == vm.STATICCALL {
if t.isPrecompiled(to) {
t.tracer.callstack[len(t.tracer.callstack)-1].Calls = parent.Calls[:len(parent.Calls)-1]
}
}
}
Expand Down

1 comment on commit 584c4c0

@ziogaschr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer this as well, but I am a bit afraid on future changes from other devs, who might foresee this return and add some code at the end of the function.
They will find it for sure before pushing code, but they might lose some dev time beforehand :)

Please sign in to comment.