mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 00:39:26 +00:00
eth/tracers: add ReturnData in the tracer's response (#27704)
The struct logger (or opcode tracer) was missing the return data field even if this was explicitly enabled by user via `"enableReturnData": true` in the config. This PR fixes this issue. Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
This commit is contained in:
parent
5d035043ea
commit
1e069cf802
1 changed files with 4 additions and 0 deletions
|
|
@ -418,6 +418,7 @@ type StructLogRes struct {
|
||||||
Depth int `json:"depth"`
|
Depth int `json:"depth"`
|
||||||
Error string `json:"error,omitempty"`
|
Error string `json:"error,omitempty"`
|
||||||
Stack *[]string `json:"stack,omitempty"`
|
Stack *[]string `json:"stack,omitempty"`
|
||||||
|
ReturnData string `json:"returnData,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"`
|
||||||
RefundCounter uint64 `json:"refund,omitempty"`
|
RefundCounter uint64 `json:"refund,omitempty"`
|
||||||
|
|
@ -443,6 +444,9 @@ func formatLogs(logs []StructLog) []StructLogRes {
|
||||||
}
|
}
|
||||||
formatted[index].Stack = &stack
|
formatted[index].Stack = &stack
|
||||||
}
|
}
|
||||||
|
if trace.ReturnData != nil && len(trace.ReturnData) > 0 {
|
||||||
|
formatted[index].ReturnData = hexutil.Bytes(trace.ReturnData).String()
|
||||||
|
}
|
||||||
if trace.Memory != nil {
|
if trace.Memory != nil {
|
||||||
memory := make([]string, 0, (len(trace.Memory)+31)/32)
|
memory := make([]string, 0, (len(trace.Memory)+31)/32)
|
||||||
for i := 0; i+32 <= len(trace.Memory); i += 32 {
|
for i := 0; i+32 <= len(trace.Memory); i += 32 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue