eth/tracers: fix
This commit is contained in:
		| @@ -19,7 +19,7 @@ func init() { | |||||||
| 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"` | 	To      string      `json:"to,omitempty"` | ||||||
| 	Value   string      `json:"value,omitempty"` | 	Value   string      `json:"value,omitempty"` | ||||||
| 	Gas     string      `json:"gas"` | 	Gas     string      `json:"gas"` | ||||||
| 	GasUsed string      `json:"gasUsed"` | 	GasUsed string      `json:"gasUsed"` | ||||||
| @@ -82,7 +82,9 @@ func (t *CallTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common. | |||||||
|  |  | ||||||
| func (t *CallTracer) CaptureExit(output []byte, gasUsed uint64, err error) { | func (t *CallTracer) CaptureExit(output []byte, gasUsed uint64, err error) { | ||||||
| 	size := len(t.callstack) | 	size := len(t.callstack) | ||||||
| 	if size > 1 { | 	if size <= 1 { | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
| 	// pop call | 	// pop call | ||||||
| 	call := t.callstack[size-1] | 	call := t.callstack[size-1] | ||||||
| 	t.callstack = t.callstack[:size-1] | 	t.callstack = t.callstack[:size-1] | ||||||
| @@ -99,7 +101,6 @@ func (t *CallTracer) CaptureExit(output []byte, gasUsed uint64, err error) { | |||||||
| 	} | 	} | ||||||
| 	t.callstack[size-1].Calls = append(t.callstack[size-1].Calls, call) | 	t.callstack[size-1].Calls = append(t.callstack[size-1].Calls, call) | ||||||
| } | } | ||||||
| } |  | ||||||
|  |  | ||||||
| func (t *CallTracer) GetResult() (json.RawMessage, error) { | func (t *CallTracer) GetResult() (json.RawMessage, error) { | ||||||
| 	if len(t.callstack) != 1 { | 	if len(t.callstack) != 1 { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user