mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-15 16:33:47 +00:00
feat: add RefundCounter to StructLogRes (#66)
This commit is contained in:
parent
e55d05d3ab
commit
9f1d8552e4
2 changed files with 18 additions and 16 deletions
|
|
@ -31,16 +31,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"`
|
||||||
Memory *[]string `json:"memory,omitempty"`
|
Memory *[]string `json:"memory,omitempty"`
|
||||||
Storage *map[string]string `json:"storage,omitempty"`
|
Storage *map[string]string `json:"storage,omitempty"`
|
||||||
ExtraData *ExtraData `json:"extraData,omitempty"`
|
RefundCounter uint64 `json:"refund,omitempty"`
|
||||||
|
ExtraData *ExtraData `json:"extraData,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExtraData struct {
|
type ExtraData struct {
|
||||||
|
|
|
||||||
|
|
@ -419,12 +419,13 @@ func FormatLogs(logs []StructLog) []types.StructLogRes {
|
||||||
formatted := make([]types.StructLogRes, len(logs))
|
formatted := make([]types.StructLogRes, len(logs))
|
||||||
for index, trace := range logs {
|
for index, trace := range logs {
|
||||||
formatted[index] = types.StructLogRes{
|
formatted[index] = types.StructLogRes{
|
||||||
Pc: trace.Pc,
|
Pc: trace.Pc,
|
||||||
Op: trace.Op.String(),
|
Op: trace.Op.String(),
|
||||||
Gas: trace.Gas,
|
Gas: trace.Gas,
|
||||||
GasCost: trace.GasCost,
|
GasCost: trace.GasCost,
|
||||||
Depth: trace.Depth,
|
Depth: trace.Depth,
|
||||||
Error: trace.ErrorString(),
|
RefundCounter: trace.RefundCounter,
|
||||||
|
Error: trace.ErrorString(),
|
||||||
}
|
}
|
||||||
if len(trace.Stack) != 0 {
|
if len(trace.Stack) != 0 {
|
||||||
stack := make([]string, len(trace.Stack))
|
stack := make([]string, len(trace.Stack))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue