Skip to content

Commit

Permalink
feat: add RefundCounter to StructLogRes (ethereum#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmountaintop authored Mar 31, 2022
1 parent e55d05d commit 9f1d855
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
21 changes: 11 additions & 10 deletions core/types/l2trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ type ExecutionResult struct {
// StructLogRes stores a structured log emitted by the EVM while replaying a
// transaction in debug mode
type StructLogRes struct {
Pc uint64 `json:"pc"`
Op string `json:"op"`
Gas uint64 `json:"gas"`
GasCost uint64 `json:"gasCost"`
Depth int `json:"depth"`
Error string `json:"error,omitempty"`
Stack *[]string `json:"stack,omitempty"`
Memory *[]string `json:"memory,omitempty"`
Storage *map[string]string `json:"storage,omitempty"`
ExtraData *ExtraData `json:"extraData,omitempty"`
Pc uint64 `json:"pc"`
Op string `json:"op"`
Gas uint64 `json:"gas"`
GasCost uint64 `json:"gasCost"`
Depth int `json:"depth"`
Error string `json:"error,omitempty"`
Stack *[]string `json:"stack,omitempty"`
Memory *[]string `json:"memory,omitempty"`
Storage *map[string]string `json:"storage,omitempty"`
RefundCounter uint64 `json:"refund,omitempty"`
ExtraData *ExtraData `json:"extraData,omitempty"`
}

type ExtraData struct {
Expand Down
13 changes: 7 additions & 6 deletions core/vm/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,13 @@ func FormatLogs(logs []StructLog) []types.StructLogRes {
formatted := make([]types.StructLogRes, len(logs))
for index, trace := range logs {
formatted[index] = types.StructLogRes{
Pc: trace.Pc,
Op: trace.Op.String(),
Gas: trace.Gas,
GasCost: trace.GasCost,
Depth: trace.Depth,
Error: trace.ErrorString(),
Pc: trace.Pc,
Op: trace.Op.String(),
Gas: trace.Gas,
GasCost: trace.GasCost,
Depth: trace.Depth,
RefundCounter: trace.RefundCounter,
Error: trace.ErrorString(),
}
if len(trace.Stack) != 0 {
stack := make([]string, len(trace.Stack))
Expand Down

0 comments on commit 9f1d855

Please sign in to comment.