From badcd0c432d23f2d3a6ca1bf0e4ca93811362590 Mon Sep 17 00:00:00 2001 From: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Date: Sat, 16 Mar 2024 16:23:49 +0800 Subject: [PATCH] fix `StructLog` (#672) --- eth/tracers/logger/gen_structlog.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eth/tracers/logger/gen_structlog.go b/eth/tracers/logger/gen_structlog.go index df06a9ee6b..9f268c15c3 100644 --- a/eth/tracers/logger/gen_structlog.go +++ b/eth/tracers/logger/gen_structlog.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/common/math" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/holiman/uint256" ) @@ -29,6 +30,7 @@ func (s StructLog) MarshalJSON() ([]byte, error) { Depth int `json:"depth"` RefundCounter uint64 `json:"refund"` Err error `json:"-"` + ExtraData *types.ExtraData `json:"extraData"` OpName string `json:"opName"` ErrorString string `json:"error,omitempty"` } @@ -45,6 +47,7 @@ func (s StructLog) MarshalJSON() ([]byte, error) { enc.Depth = s.Depth enc.RefundCounter = s.RefundCounter enc.Err = s.Err + enc.ExtraData = s.ExtraData enc.OpName = s.OpName() enc.ErrorString = s.ErrorString() return json.Marshal(&enc) @@ -65,6 +68,7 @@ func (s *StructLog) UnmarshalJSON(input []byte) error { Depth *int `json:"depth"` RefundCounter *uint64 `json:"refund"` Err error `json:"-"` + ExtraData *types.ExtraData `json:"extraData"` } var dec StructLog if err := json.Unmarshal(input, &dec); err != nil { @@ -106,5 +110,8 @@ func (s *StructLog) UnmarshalJSON(input []byte) error { if dec.Err != nil { s.Err = dec.Err } + if dec.ExtraData != nil { + s.ExtraData = dec.ExtraData + } return nil }