Skip to content

Commit b5a129e

Browse files
lispcrjl493456442
andauthored
internal/ethapi: add refund to StructLogRes (#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 763b3f8 commit b5a129e

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
@@ -1135,28 +1135,30 @@ type ExecutionResult struct {
11351135
// StructLogRes stores a structured log emitted by the EVM while replaying a
11361136
// transaction in debug mode
11371137
type StructLogRes struct {
1138-
Pc uint64 `json:"pc"`
1139-
Op string `json:"op"`
1140-
Gas uint64 `json:"gas"`
1141-
GasCost uint64 `json:"gasCost"`
1142-
Depth int `json:"depth"`
1143-
Error string `json:"error,omitempty"`
1144-
Stack *[]string `json:"stack,omitempty"`
1145-
Memory *[]string `json:"memory,omitempty"`
1146-
Storage *map[string]string `json:"storage,omitempty"`
1138+
Pc uint64 `json:"pc"`
1139+
Op string `json:"op"`
1140+
Gas uint64 `json:"gas"`
1141+
GasCost uint64 `json:"gasCost"`
1142+
Depth int `json:"depth"`
1143+
Error string `json:"error,omitempty"`
1144+
Stack *[]string `json:"stack,omitempty"`
1145+
Memory *[]string `json:"memory,omitempty"`
1146+
Storage *map[string]string `json:"storage,omitempty"`
1147+
RefundCounter uint64 `json:"refund,omitempty"`
11471148
}
11481149

11491150
// FormatLogs formats EVM returned structured logs for json output
11501151
func FormatLogs(logs []logger.StructLog) []StructLogRes {
11511152
formatted := make([]StructLogRes, len(logs))
11521153
for index, trace := range logs {
11531154
formatted[index] = StructLogRes{
1154-
Pc: trace.Pc,
1155-
Op: trace.Op.String(),
1156-
Gas: trace.Gas,
1157-
GasCost: trace.GasCost,
1158-
Depth: trace.Depth,
1159-
Error: trace.ErrorString(),
1155+
Pc: trace.Pc,
1156+
Op: trace.Op.String(),
1157+
Gas: trace.Gas,
1158+
GasCost: trace.GasCost,
1159+
Depth: trace.Depth,
1160+
Error: trace.ErrorString(),
1161+
RefundCounter: trace.RefundCounter,
11601162
}
11611163
if trace.Stack != nil {
11621164
stack := make([]string, len(trace.Stack))

0 commit comments

Comments
 (0)