mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
Remove redundant pointer references
This commit is contained in:
parent
6ae83f6735
commit
39fa775622
1 changed files with 14 additions and 14 deletions
|
|
@ -425,17 +425,17 @@ type ExecutionResult struct {
|
||||||
// StructLogRes stores a structured log emitted by the EVM while replaying a
|
// StructLogRes stores a structured log emitted by the EVM while replaying a
|
||||||
// transaction in debug mode
|
// transaction in debug mode
|
||||||
type StructLogRes struct {
|
type StructLogRes struct {
|
||||||
Pc uint64 `json:"pc"`
|
Pc uint64 `json:"pc"`
|
||||||
Op string `json:"op"`
|
Op string `json:"op"`
|
||||||
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 string `json:"error,omitempty"`
|
Error string `json:"error,omitempty"`
|
||||||
Stack *[]string `json:"stack,omitempty"`
|
Stack []string `json:"stack,omitempty"`
|
||||||
ReturnData string `json:"returnData,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"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// formatLogs formats EVM returned structured logs for json output
|
// formatLogs formats EVM returned structured logs for json output
|
||||||
|
|
@ -456,7 +456,7 @@ func formatLogs(logs []StructLog) []StructLogRes {
|
||||||
for i, stackValue := range trace.Stack {
|
for i, stackValue := range trace.Stack {
|
||||||
stack[i] = stackValue.Hex()
|
stack[i] = stackValue.Hex()
|
||||||
}
|
}
|
||||||
formatted[index].Stack = &stack
|
formatted[index].Stack = stack
|
||||||
}
|
}
|
||||||
if trace.ReturnData != nil && len(trace.ReturnData) > 0 {
|
if trace.ReturnData != nil && len(trace.ReturnData) > 0 {
|
||||||
formatted[index].ReturnData = hexutil.Bytes(trace.ReturnData).String()
|
formatted[index].ReturnData = hexutil.Bytes(trace.ReturnData).String()
|
||||||
|
|
@ -466,14 +466,14 @@ func formatLogs(logs []StructLog) []StructLogRes {
|
||||||
for i := 0; i+32 <= len(trace.Memory); i += 32 {
|
for i := 0; i+32 <= len(trace.Memory); i += 32 {
|
||||||
memory = append(memory, fmt.Sprintf("%x", trace.Memory[i:i+32]))
|
memory = append(memory, fmt.Sprintf("%x", trace.Memory[i:i+32]))
|
||||||
}
|
}
|
||||||
formatted[index].Memory = &memory
|
formatted[index].Memory = memory
|
||||||
}
|
}
|
||||||
if trace.Storage != nil {
|
if trace.Storage != nil {
|
||||||
storage := make(map[string]string)
|
storage := make(map[string]string)
|
||||||
for i, storageValue := range trace.Storage {
|
for i, storageValue := range trace.Storage {
|
||||||
storage[fmt.Sprintf("%x", i)] = fmt.Sprintf("%x", storageValue)
|
storage[fmt.Sprintf("%x", i)] = fmt.Sprintf("%x", storageValue)
|
||||||
}
|
}
|
||||||
formatted[index].Storage = &storage
|
formatted[index].Storage = storage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return formatted
|
return formatted
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue