tracers

package
v0.22.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

README

Tracers

This package supplies access to the tracers of the EVM. It's a proxy + copy of from geth - go-ethereum/eth/tracers.

All available tracers (defined in the native package) register into the tracers package.

Documentation

Overview

nolint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLookup

func RegisterLookup(wildcard bool, lookup lookupFunc)

RegisterLookup registers a method as a lookup for tracers, meaning that users can invoke a named tracer through that lookup. If 'wildcard' is true, then the lookup will be placed last. This is typically meant for interpreted engines (js) which can evaluate dynamic user-supplied code.

Types

type Context

type Context struct {
	BlockHash gethcommon.Hash // Hash of the block the tx is contained within (zero if dangling tx or call)
	TxIndex   int             // Index of the transaction within a block (zero if dangling tx or call)
	TxHash    gethcommon.Hash // Hash of the transaction being traced (zero if dangling call)
}

Context contains some contextual infos for a transaction execution that is not available from within the EVM object.

type DebugLogs

type DebugLogs struct {
	RelAddress1    *gethcommon.Address `json:"relAddress1"`
	RelAddress2    *gethcommon.Address `json:"relAddress2"`
	RelAddress3    *gethcommon.Address `json:"relAddress3"`
	RelAddress4    *gethcommon.Address `json:"relAddress4"`
	LifecycleEvent bool                `json:"lifecycleEvent"`

	gethtypes.Log
}

DebugLogs are the logs returned when using the DebugGetLogs endpoint

func (DebugLogs) MarshalJSON

func (l DebugLogs) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON. this holds a copy of the gethtypes.Log log marshaller

type TraceConfig

type TraceConfig struct {
	*gethlogger.Config
	Tracer  *string
	Timeout *string
	Reexec  *uint64
	// Config specific to given tracer. Note struct logger
	// config are historically embedded in main object.
	TracerConfig json.RawMessage
}

TraceConfig holds extra parameters to trace functions.

type Tracer

type Tracer interface {
	vm.EVMLogger
	GetResult() (json.RawMessage, error)
	// Stop terminates execution of the tracer at the first opportune moment.
	Stop(err error)
}

Tracer interface extends vm.EVMLogger and additionally allows collecting the tracing result.

func New

func New(code string, ctx *Context) (Tracer, error)

New returns a new instance of a tracer, by iterating through the registered lookups.

Directories

Path Synopsis
// Package native: This file was copied/adapted from geth - go-ethereum/eth/tracers // // // Copyright 2021 The go-ethereum Authors // This file is part of the go-ethereum library.
// Package native: This file was copied/adapted from geth - go-ethereum/eth/tracers // // // Copyright 2021 The go-ethereum Authors // This file is part of the go-ethereum library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL