structtracer

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EnableMemory     bool // enable memory capture
	EnableStack      bool // enable stack capture
	EnableStorage    bool // enable storage capture
	EnableReturnData bool // enable return data capture
	EnableStructLogs bool // enable struct logs capture
}

type StructLog

type StructLog struct {
	Pc            uint64            `json:"pc"`
	Op            string            `json:"op"`
	Gas           uint64            `json:"gas"`
	GasCost       uint64            `json:"gasCost"`
	Depth         int               `json:"depth"`
	Error         string            `json:"error,omitempty"`
	Stack         []string          `json:"stack,omitempty"`
	Memory        []string          `json:"memory,omitempty"`
	Storage       map[string]string `json:"storage,omitempty"`
	RefundCounter uint64            `json:"refund,omitempty"`
	ReturnData    string            `json:"returnData,omitempty"`
}

type StructTraceResult

type StructTraceResult struct {
	Failed      bool        `json:"failed"`
	Gas         uint64      `json:"gas"`
	ReturnValue string      `json:"returnValue"`
	StructLogs  []StructLog `json:"structLogs"`
}

type StructTracer

type StructTracer struct {
	Config Config
	// contains filtered or unexported fields
}

func NewStructTracer

func NewStructTracer(config Config) *StructTracer

func (*StructTracer) CallEnd

func (t *StructTracer) CallEnd(
	depth int,
	output []byte,
	err error,
)

func (*StructTracer) CallStart

func (t *StructTracer) CallStart(
	depth int,
	from, to types.Address,
	callType int,
	gas uint64,
	value *big.Int,
	input []byte,
)

func (*StructTracer) Cancel

func (t *StructTracer) Cancel(err error)

func (*StructTracer) CaptureState

func (t *StructTracer) CaptureState(
	memory []byte,
	stack []*big.Int,
	opCode int,
	contractAddress types.Address,
	sp int,
	host tracer.RuntimeHost,
	state tracer.VMState,
)

func (*StructTracer) Clear

func (t *StructTracer) Clear()

func (*StructTracer) ExecuteState

func (t *StructTracer) ExecuteState(
	contractAddress types.Address,
	ip uint64,
	opCode string,
	availableGas uint64,
	cost uint64,
	lastReturnData []byte,
	depth int,
	err error,
	host tracer.RuntimeHost,
)

func (*StructTracer) GetResult

func (t *StructTracer) GetResult() (interface{}, error)

func (*StructTracer) TxEnd

func (t *StructTracer) TxEnd(gasLeft uint64)

func (*StructTracer) TxStart

func (t *StructTracer) TxStart(gasLimit uint64)

Jump to

Keyboard shortcuts

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