Skip to content

Commit 8e24806

Browse files
lispcrjl493456442
authored andcommitted
internal/ethapi: add refund to StructLogRes (ethereum#24567)
* internal/ethapi: add refund to StructLogRes * Update internal/ethapi/api.go Co-authored-by: rjl493456442 <[email protected]> Co-authored-by: rjl493456442 <[email protected]>
1 parent 8aac390 commit 8e24806

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

internal/ethapi/api.go

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,28 +1188,30 @@ type ExecutionResult struct {
11881188
// StructLogRes stores a structured log emitted by the EVM while replaying a
11891189
// transaction in debug mode
11901190
type StructLogRes struct {
1191-
Pc uint64 `json:"pc"`
1192-
Op string `json:"op"`
1193-
Gas uint64 `json:"gas"`
1194-
GasCost uint64 `json:"gasCost"`
1195-
Depth int `json:"depth"`
1196-
Error string `json:"error,omitempty"`
1197-
Stack *[]string `json:"stack,omitempty"`
1198-
Memory *[]string `json:"memory,omitempty"`
1199-
Storage *map[string]string `json:"storage,omitempty"`
1191+
Pc uint64 `json:"pc"`
1192+
Op string `json:"op"`
1193+
Gas uint64 `json:"gas"`
1194+
GasCost uint64 `json:"gasCost"`
1195+
Depth int `json:"depth"`
1196+
Error string `json:"error,omitempty"`
1197+
Stack *[]string `json:"stack,omitempty"`
1198+
Memory *[]string `json:"memory,omitempty"`
1199+
Storage *map[string]string `json:"storage,omitempty"`
1200+
RefundCounter uint64 `json:"refund,omitempty"`
12001201
}
12011202

12021203
// FormatLogs formats EVM returned structured logs for json output
12031204
func FormatLogs(logs []logger.StructLog) []StructLogRes {
12041205
formatted := make([]StructLogRes, len(logs))
12051206
for index, trace := range logs {
12061207
formatted[index] = StructLogRes{
1207-
Pc: trace.Pc,
1208-
Op: trace.Op.String(),
1209-
Gas: trace.Gas,
1210-
GasCost: trace.GasCost,
1211-
Depth: trace.Depth,
1212-
Error: trace.ErrorString(),
1208+
Pc: trace.Pc,
1209+
Op: trace.Op.String(),
1210+
Gas: trace.Gas,
1211+
GasCost: trace.GasCost,
1212+
Depth: trace.Depth,
1213+
Error: trace.ErrorString(),
1214+
RefundCounter: trace.RefundCounter,
12131215
}
12141216
if trace.Stack != nil {
12151217
stack := make([]string, len(trace.Stack))

0 commit comments

Comments
 (0)