Unverified Commit b305591e authored by Marius van der Wijden's avatar Marius van der Wijden Committed by GitHub

core/vm: marshall returnData as hexstring in trace logs (#21715)

* core/vm: marshall returnData as hexstring in trace logs

* core/vm: marshall returnData as hexstring in trace logs
parent 51d026ca
...@@ -24,7 +24,7 @@ func (s StructLog) MarshalJSON() ([]byte, error) { ...@@ -24,7 +24,7 @@ func (s StructLog) MarshalJSON() ([]byte, error) {
MemorySize int `json:"memSize"` MemorySize int `json:"memSize"`
Stack []*math.HexOrDecimal256 `json:"stack"` Stack []*math.HexOrDecimal256 `json:"stack"`
ReturnStack []math.HexOrDecimal64 `json:"returnStack"` ReturnStack []math.HexOrDecimal64 `json:"returnStack"`
ReturnData []byte `json:"returnData"` ReturnData hexutil.Bytes `json:"returnData"`
Storage map[common.Hash]common.Hash `json:"-"` Storage map[common.Hash]common.Hash `json:"-"`
Depth int `json:"depth"` Depth int `json:"depth"`
RefundCounter uint64 `json:"refund"` RefundCounter uint64 `json:"refund"`
...@@ -72,7 +72,7 @@ func (s *StructLog) UnmarshalJSON(input []byte) error { ...@@ -72,7 +72,7 @@ func (s *StructLog) UnmarshalJSON(input []byte) error {
MemorySize *int `json:"memSize"` MemorySize *int `json:"memSize"`
Stack []*math.HexOrDecimal256 `json:"stack"` Stack []*math.HexOrDecimal256 `json:"stack"`
ReturnStack []math.HexOrDecimal64 `json:"returnStack"` ReturnStack []math.HexOrDecimal64 `json:"returnStack"`
ReturnData []byte `json:"returnData"` ReturnData *hexutil.Bytes `json:"returnData"`
Storage map[common.Hash]common.Hash `json:"-"` Storage map[common.Hash]common.Hash `json:"-"`
Depth *int `json:"depth"` Depth *int `json:"depth"`
RefundCounter *uint64 `json:"refund"` RefundCounter *uint64 `json:"refund"`
...@@ -113,7 +113,7 @@ func (s *StructLog) UnmarshalJSON(input []byte) error { ...@@ -113,7 +113,7 @@ func (s *StructLog) UnmarshalJSON(input []byte) error {
} }
} }
if dec.ReturnData != nil { if dec.ReturnData != nil {
s.ReturnData = dec.ReturnData s.ReturnData = *dec.ReturnData
} }
if dec.Storage != nil { if dec.Storage != nil {
s.Storage = dec.Storage s.Storage = dec.Storage
......
...@@ -82,6 +82,7 @@ type structLogMarshaling struct { ...@@ -82,6 +82,7 @@ type structLogMarshaling struct {
Gas math.HexOrDecimal64 Gas math.HexOrDecimal64
GasCost math.HexOrDecimal64 GasCost math.HexOrDecimal64
Memory hexutil.Bytes Memory hexutil.Bytes
ReturnData hexutil.Bytes
OpName string `json:"opName"` // adds call to OpName() in MarshalJSON OpName string `json:"opName"` // adds call to OpName() in MarshalJSON
ErrorString string `json:"error"` // adds call to ErrorString() in MarshalJSON ErrorString string `json:"error"` // adds call to ErrorString() in MarshalJSON
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment