mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
fix(trace): change error type to string (#119)
* Fix bug of error type * Fix bug of error type
This commit is contained in:
parent
21b65f4944
commit
f731427282
1 changed files with 4 additions and 2 deletions
|
|
@ -75,7 +75,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"`
|
||||||
|
|
@ -88,7 +88,9 @@ type StructLogRes struct {
|
||||||
func NewStructLogResBasic(pc uint64, op string, gas, gasCost uint64, depth int, refundCounter uint64, err error) *StructLogRes {
|
func NewStructLogResBasic(pc uint64, op string, gas, gasCost uint64, depth int, refundCounter uint64, err error) *StructLogRes {
|
||||||
logRes := loggerResPool.Get().(*StructLogRes)
|
logRes := loggerResPool.Get().(*StructLogRes)
|
||||||
logRes.Pc, logRes.Op, logRes.Gas, logRes.GasCost, logRes.Depth, logRes.RefundCounter = pc, op, gas, gasCost, depth, refundCounter
|
logRes.Pc, logRes.Op, logRes.Gas, logRes.GasCost, logRes.Depth, logRes.RefundCounter = pc, op, gas, gasCost, depth, refundCounter
|
||||||
logRes.Error = err
|
if err != nil {
|
||||||
|
logRes.Error = err.Error()
|
||||||
|
}
|
||||||
runtime.SetFinalizer(logRes, func(logRes *StructLogRes) {
|
runtime.SetFinalizer(logRes, func(logRes *StructLogRes) {
|
||||||
logRes.Stack = logRes.Stack[:0]
|
logRes.Stack = logRes.Stack[:0]
|
||||||
logRes.Memory = logRes.Memory[:0]
|
logRes.Memory = logRes.Memory[:0]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue