internal/ethapi: fix trace log marshalling (#23292)

pull/23328/head
gary rong 3 years ago committed by GitHub
parent c38fab912b
commit f311488d2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      internal/ethapi/api.go

@ -1120,7 +1120,7 @@ type StructLogRes struct {
Gas uint64 `json:"gas"` Gas uint64 `json:"gas"`
GasCost uint64 `json:"gasCost"` GasCost uint64 `json:"gasCost"`
Depth int `json:"depth"` Depth int `json:"depth"`
Error error `json:"error,omitempty"` Error string `json:"error,omitempty"`
Stack *[]string `json:"stack,omitempty"` Stack *[]string `json:"stack,omitempty"`
Memory *[]string `json:"memory,omitempty"` Memory *[]string `json:"memory,omitempty"`
Storage *map[string]string `json:"storage,omitempty"` Storage *map[string]string `json:"storage,omitempty"`
@ -1136,7 +1136,7 @@ func FormatLogs(logs []vm.StructLog) []StructLogRes {
Gas: trace.Gas, Gas: trace.Gas,
GasCost: trace.GasCost, GasCost: trace.GasCost,
Depth: trace.Depth, Depth: trace.Depth,
Error: trace.Err, Error: trace.ErrorString(),
} }
if trace.Stack != nil { if trace.Stack != nil {
stack := make([]string, len(trace.Stack)) stack := make([]string, len(trace.Stack))

Loading…
Cancel
Save