eth/tracers: make callFrame private
This commit is contained in:
parent
aff90d3f88
commit
a2b0d3d48e
|
@ -16,7 +16,7 @@ func init() {
|
||||||
Register("callTracerNative", NewCallTracer)
|
Register("callTracerNative", NewCallTracer)
|
||||||
}
|
}
|
||||||
|
|
||||||
type CallFrame struct {
|
type callFrame struct {
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
From string `json:"from"`
|
From string `json:"from"`
|
||||||
To string `json:"to,omitempty"`
|
To string `json:"to,omitempty"`
|
||||||
|
@ -26,20 +26,20 @@ type CallFrame struct {
|
||||||
Input string `json:"input"`
|
Input string `json:"input"`
|
||||||
Output string `json:"output,omitempty"`
|
Output string `json:"output,omitempty"`
|
||||||
Error string `json:"error,omitempty"`
|
Error string `json:"error,omitempty"`
|
||||||
Calls []CallFrame `json:"calls,omitempty"`
|
Calls []callFrame `json:"calls,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CallTracer struct {
|
type CallTracer struct {
|
||||||
callstack []CallFrame
|
callstack []callFrame
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCallTracer() Tracer {
|
func NewCallTracer() Tracer {
|
||||||
t := &CallTracer{callstack: make([]CallFrame, 1)}
|
t := &CallTracer{callstack: make([]callFrame, 1)}
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *CallTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) {
|
func (t *CallTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) {
|
||||||
t.callstack[0] = CallFrame{
|
t.callstack[0] = callFrame{
|
||||||
Type: "CALL",
|
Type: "CALL",
|
||||||
From: addrToHex(from),
|
From: addrToHex(from),
|
||||||
To: addrToHex(to),
|
To: addrToHex(to),
|
||||||
|
@ -67,7 +67,7 @@ func (t *CallTracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cos
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *CallTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
|
func (t *CallTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, gas uint64, value *big.Int) {
|
||||||
call := CallFrame{
|
call := callFrame{
|
||||||
Type: typ.String(),
|
Type: typ.String(),
|
||||||
From: addrToHex(from),
|
From: addrToHex(from),
|
||||||
To: addrToHex(to),
|
To: addrToHex(to),
|
||||||
|
|
Loading…
Reference in New Issue