Documentation ¶
Overview ¶
Package tracers is a collection of JavaScript transaction tracers.
Index ¶
- type ActionStorage
- type ParityBlockTracer
- func (jst *ParityBlockTracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error
- func (jst *ParityBlockTracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- func (jst *ParityBlockTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, ...) error
- func (jst *ParityBlockTracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) (vm.HookAfter, error)
- func (jst *ParityBlockTracer) GetResult() ([]json.RawMessage, error)
- func (jst *ParityBlockTracer) GetStorage() *TraceBlockStorage
- type ParityTxTracer
- type RosettaBlockTracer
- type RosettaLogItem
- type TraceBlockStorage
- func (ts *TraceBlockStorage) FromDB(read func([]byte) ([]byte, error)) error
- func (ts *TraceBlockStorage) KeyDB() []byte
- func (ts *TraceBlockStorage) ToDB(write func([]byte, []byte))
- func (ts *TraceBlockStorage) ToJson() (json.RawMessage, error)
- func (ts *TraceBlockStorage) TxJson(index int) ([]json.RawMessage, error)
- type Tracer
- func (jst *Tracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error
- func (jst *Tracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) error
- func (jst *Tracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, ...) error
- func (jst *Tracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, ...) (vm.HookAfter, error)
- func (jst *Tracer) GetResult() (json.RawMessage, error)
- func (jst *Tracer) Stop(err error)
- type TxStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionStorage ¶
type ParityBlockTracer ¶
type ParityBlockTracer struct { Hash common.Hash Number uint64 // contains filtered or unexported fields }
func (*ParityBlockTracer) CaptureEnd ¶
func (jst *ParityBlockTracer) CaptureEnd(output []byte, gasUsed uint64, t time.Duration, err error) error
CaptureEnd is called after the call finishes to finalize the tracing.
func (*ParityBlockTracer) CaptureFault ¶
func (jst *ParityBlockTracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, depth int, err error) error
CaptureFault implements the ParityBlockTracer interface to trace an execution fault while running an opcode.
func (*ParityBlockTracer) CaptureStart ¶
func (jst *ParityBlockTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) error
CaptureStart implements the ParityBlockTracer interface to initialize the tracing operation.
func (*ParityBlockTracer) CaptureState ¶
func (jst *ParityBlockTracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, depth int, err error) (vm.HookAfter, error)
CaptureState implements the ParityBlockTracer interface to trace a single step of VM execution.
func (*ParityBlockTracer) GetResult ¶
func (jst *ParityBlockTracer) GetResult() ([]json.RawMessage, error)
GetResult calls the Javascript 'result' function and returns its value, or any accumulated error
func (*ParityBlockTracer) GetStorage ¶
func (jst *ParityBlockTracer) GetStorage() *TraceBlockStorage
get TraceBlockStorage from tracer, then store it to db
type ParityTxTracer ¶
type ParityTxTracer struct {
// contains filtered or unexported fields
}
type RosettaBlockTracer ¶
type RosettaBlockTracer struct { *ParityBlockTracer // contains filtered or unexported fields }
func (*RosettaBlockTracer) AddRosettaLog ¶
func (rbt *RosettaBlockTracer) AddRosettaLog(op vm.OpCode, from, to *vm.RosettaLogAddressItem, val *big.Int)
func (*RosettaBlockTracer) GetResult ¶
func (rbt *RosettaBlockTracer) GetResult() ([]*RosettaLogItem, error)
type RosettaLogItem ¶
type TraceBlockStorage ¶
type TraceBlockStorage struct { Hash common.Hash Number uint64 AddressTable []common.Address // address table DataKeyTable []common.Hash // data key table TraceStorages [][]byte // trace data, length equal the number of transaction in a block // contains filtered or unexported fields }
func (*TraceBlockStorage) FromDB ¶
func (ts *TraceBlockStorage) FromDB(read func([]byte) ([]byte, error)) error
load TraceBlockStorage from db
func (*TraceBlockStorage) ToDB ¶
func (ts *TraceBlockStorage) ToDB(write func([]byte, []byte))
store TraceBlockStorage to db
func (*TraceBlockStorage) ToJson ¶
func (ts *TraceBlockStorage) ToJson() (json.RawMessage, error)
return trace result of a block
func (*TraceBlockStorage) TxJson ¶
func (ts *TraceBlockStorage) TxJson(index int) ([]json.RawMessage, error)
return trace result of a tx for giving index
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 ¶
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 ¶
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, 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(env *vm.EVM, 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, contract *vm.Contract, depth int, err error) (vm.HookAfter, error)
CaptureState implements the Tracer interface to trace a single step of VM execution.
type TxStorage ¶
type TxStorage struct { Hash common.Hash Storages []*ActionStorage }