mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
Revert "cmd,eth: register live tracer with Backend interface"
This reverts commit 54f4a124632099c158debd151f2a884a54f5e935. Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
560f2dc59c
commit
61ac985a93
4 changed files with 7 additions and 7 deletions
|
|
@ -1937,7 +1937,7 @@ func RegisterEthService(stack *node.Node, cfg *ethconfig.Config) (ethapi.Backend
|
|||
if cfg.VMTraceJsonConfig != "" {
|
||||
traceConfig = json.RawMessage(cfg.VMTraceJsonConfig)
|
||||
}
|
||||
t, err := tracers.LiveDirectory.New(cfg.VMTrace, traceConfig, backend.APIBackend)
|
||||
t, err := tracers.LiveDirectory.New(cfg.VMTrace, traceConfig)
|
||||
if err != nil {
|
||||
Fatalf("failed to create tracer %s: %v", cfg.VMTrace, err)
|
||||
}
|
||||
|
|
@ -2205,7 +2205,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
|
|||
if ctx.IsSet(VMTraceJsonConfigFlag.Name) {
|
||||
config = json.RawMessage(ctx.String(VMTraceJsonConfigFlag.Name))
|
||||
}
|
||||
t, err := tracers.LiveDirectory.New(name, config, nil)
|
||||
t, err := tracers.LiveDirectory.New(name, config)
|
||||
if err != nil {
|
||||
Fatalf("Failed to create tracer %q: %v", name, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/tracing"
|
||||
)
|
||||
|
||||
type ctorFunc func(config json.RawMessage, backend Backend) (*tracing.Hooks, error)
|
||||
type ctorFunc func(config json.RawMessage) (*tracing.Hooks, error)
|
||||
|
||||
// LiveDirectory is the collection of tracers which can be used
|
||||
// during normal block import operations.
|
||||
|
|
@ -23,9 +23,9 @@ func (d *liveDirectory) Register(name string, f ctorFunc) {
|
|||
}
|
||||
|
||||
// New instantiates a tracer by name.
|
||||
func (d *liveDirectory) New(name string, config json.RawMessage, backend Backend) (*tracing.Hooks, error) {
|
||||
func (d *liveDirectory) New(name string, config json.RawMessage) (*tracing.Hooks, error) {
|
||||
if f, ok := d.elems[name]; ok {
|
||||
return f(config, backend)
|
||||
return f(config)
|
||||
}
|
||||
return nil, errors.New("not found")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ func init() {
|
|||
// as soon as we have a real live tracer.
|
||||
type noop struct{}
|
||||
|
||||
func newNoopTracer(_ json.RawMessage, _ tracers.Backend) (*tracing.Hooks, error) {
|
||||
func newNoopTracer(_ json.RawMessage) (*tracing.Hooks, error) {
|
||||
t := &noop{}
|
||||
return &tracing.Hooks{
|
||||
OnTxStart: t.OnTxStart,
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ type supplyTracerConfig struct {
|
|||
MaxSize int `json:"maxSize"` // MaxSize is the maximum size in megabytes of the tracer log file before it gets rotated. It defaults to 100 megabytes.
|
||||
}
|
||||
|
||||
func newSupply(cfg json.RawMessage, _ tracers.Backend) (*tracing.Hooks, error) {
|
||||
func newSupply(cfg json.RawMessage) (*tracing.Hooks, error) {
|
||||
var config supplyTracerConfig
|
||||
if cfg != nil {
|
||||
if err := json.Unmarshal(cfg, &config); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue