tracers

package
v0.0.0-...-6ec8c49 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: GPL-3.0 Imports: 18 Imported by: 1

Documentation

Overview

Package tracers is a collection of JavaScript transaction tracers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsTracer

type JsTracer struct {
	// contains filtered or unexported fields
}

Tracer provides an implementation of Tracer that evaluates a Javascript function for each VM execution step.

func New2

func New2(code string) (*JsTracer, error)

New instantiates a new tracer instance. code specifies a Javascript snippet, which must evaluate to an expression returning an object with 'step', 'fault' and 'result' functions.

func (*JsTracer) CaptureEnd

func (jst *JsTracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error)

CaptureEnd is called after the call finishes to finalize the tracing.

func (*JsTracer) CaptureEnter

func (jst *JsTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int)

CaptureEnter is called when EVM enters a new scope (via call, create or selfdestruct).

func (*JsTracer) CaptureExit

func (jst *JsTracer) CaptureExit(output []byte, gasUsed uint64, err error)

CaptureExit is called when EVM exits a scope, even if the scope didn't execute any code.

func (*JsTracer) CaptureFault

func (jst *JsTracer) CaptureFault(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, depth int, err error)

CaptureFault implements the Tracer interface to trace an execution fault while running an opcode.

func (*JsTracer) CaptureStart

func (jst *JsTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int)

CaptureStart implements the Tracer interface to initialize the tracing operation.

func (*JsTracer) CaptureState

func (jst *JsTracer) CaptureState(pc uint64, op vm.OpCode, gas, cost uint64, scope *vm.ScopeContext, rData []byte, depth int, err error)

CaptureState implements the Tracer interface to trace a single step of VM execution.

func (*JsTracer) GetResult

func (jst *JsTracer) GetResult() (json.RawMessage, error)

GetResult calls the Javascript 'result' function and returns its value, or any accumulated error

func (*JsTracer) Stop

func (jst *JsTracer) Stop(err error)

Stop terminates execution of the tracer at the first opportune moment.

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

Tracer provides an implementation of Tracer that evaluates a Javascript function for each VM execution step.

func New

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

New instantiates a new tracer instance. code specifies a Javascript snippet, which must evaluate to an expression returning an object with 'step', 'fault' and 'result' functions.

func (*Tracer) CaptureEnd

func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error

CaptureEnd is called after the call finishes to finalize the tracing.

func (*Tracer) CaptureFault

func (jst *Tracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, rStack *vm.ReturnStack, contract *vm.Contract, depth int, err error) error

CaptureFault implements the Tracer interface to trace an execution fault while running an opcode.

func (*Tracer) CaptureStart

func (jst *Tracer) CaptureStart(from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) error

CaptureStart implements the Tracer interface to initialize the tracing operation.

func (*Tracer) CaptureState

func (jst *Tracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, rStack *vm.ReturnStack, rdata []byte, contract *vm.Contract, depth int, err error) error

CaptureState implements the Tracer interface to trace a single step of VM execution.

func (*Tracer) GetResult

func (jst *Tracer) GetResult() (json.RawMessage, error)

GetResult calls the Javascript 'result' function and returns its value, or any accumulated error

func (*Tracer) Stop

func (jst *Tracer) Stop(err error)

Stop terminates execution of the tracer at the first opportune moment.

Directories

Path Synopsis
internal
tracers
Package tracers contains the actual JavaScript tracer assets.
Package tracers contains the actual JavaScript tracer assets.

Jump to

Keyboard shortcuts

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