diff --git a/eth/tracers/internal/tracetest/calltrace_test.go b/eth/tracers/internal/tracetest/calltrace_test.go index 809df68b36d7..cc7d220e52b0 100644 --- a/eth/tracers/internal/tracetest/calltrace_test.go +++ b/eth/tracers/internal/tracetest/calltrace_test.go @@ -106,6 +106,9 @@ func testCallTracer(tracerName string, dirPath string, t *testing.T) { continue } file := file // capture range variable + if file.Name() != "simple_onlytop.json" { + continue + } t.Run(camel(strings.TrimSuffix(file.Name(), ".json")), func(t *testing.T) { t.Parallel() @@ -389,6 +392,8 @@ func TestInternals(t *testing.T) { t.Fatalf("test %v: failed to sign transaction: %v", tc.name, err) } + state.StateDB.SetLogger(tc.tracer.Hooks) + txContext := vm.TxContext{ Origin: origin, GasPrice: tx.GasPrice(), diff --git a/eth/tracers/native/call.go b/eth/tracers/native/call.go index 76691b7a6565..92bf73afdf82 100644 --- a/eth/tracers/native/call.go +++ b/eth/tracers/native/call.go @@ -155,7 +155,7 @@ func newCallTracerObject(ctx *tracers.Context, cfg json.RawMessage) (*callTracer // OnEnter is called when EVM enters a new scope (via call, create or selfdestruct). func (t *callTracer) OnEnter(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) { t.depth = depth - if t.config.OnlyTopCall && depth > 1 { + if t.config.OnlyTopCall && depth > 0 { return } // Skip if tracing was interrupted