From efa411ffb7771161879742809d96cbf26f5b5e19 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Mon, 19 Aug 2024 15:56:30 +0000 Subject: [PATCH] native/callflat: register parity tracer Signed-off-by: jsvisa --- eth/tracers/native/call_flat.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eth/tracers/native/call_flat.go b/eth/tracers/native/call_flat.go index b1d7925003..3fe8f357ca 100644 --- a/eth/tracers/native/call_flat.go +++ b/eth/tracers/native/call_flat.go @@ -38,6 +38,7 @@ import ( func init() { tracers.DefaultDirectory.Register("flatCallTracer", newFlatCallTracer, false) + tracers.DefaultDirectory.Register("parityTracer", newParityTracer, false) } var parityErrorMapping = map[string]string{ @@ -153,6 +154,11 @@ func newFlatCallTracer(ctx *tracers.Context, cfg json.RawMessage) (*tracers.Trac }, nil } +// newParityTracer returns a new flatCallTracer with parity style. +func newParityTracer(ctx *tracers.Context, _ json.RawMessage) (*tracers.Tracer, error) { + return newFlatCallTracer(ctx, []byte(`{"includePrecompiles": true, "convertParityErrors": true}`)) +} + // OnEnter is called when EVM enters a new scope (via call, create or selfdestruct). func (t *flatCallTracer) OnEnter(depth int, typ byte, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) { if t.interrupt.Load() {