mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-15 12:36:48 +00:00
core/tracing: go generate
This commit is contained in:
parent
a03d1cdc1c
commit
6feef35191
1 changed files with 12 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ var _ = (*structLogMarshaling)(nil)
|
||||||
func (s StructLog) MarshalJSON() ([]byte, error) {
|
func (s StructLog) MarshalJSON() ([]byte, error) {
|
||||||
type StructLog struct {
|
type StructLog struct {
|
||||||
Pc uint64 `json:"pc"`
|
Pc uint64 `json:"pc"`
|
||||||
|
Section uint64 `json:"section,omitempty"`
|
||||||
Op vm.OpCode `json:"op"`
|
Op vm.OpCode `json:"op"`
|
||||||
Gas math.HexOrDecimal64 `json:"gas"`
|
Gas math.HexOrDecimal64 `json:"gas"`
|
||||||
GasCost math.HexOrDecimal64 `json:"gasCost"`
|
GasCost math.HexOrDecimal64 `json:"gasCost"`
|
||||||
|
|
@ -27,6 +28,7 @@ func (s StructLog) MarshalJSON() ([]byte, error) {
|
||||||
ReturnData hexutil.Bytes `json:"returnData,omitempty"`
|
ReturnData hexutil.Bytes `json:"returnData,omitempty"`
|
||||||
Storage map[common.Hash]common.Hash `json:"-"`
|
Storage map[common.Hash]common.Hash `json:"-"`
|
||||||
Depth int `json:"depth"`
|
Depth int `json:"depth"`
|
||||||
|
FunctionDepth uint64 `json:"functionDepth,omitempty"`
|
||||||
RefundCounter uint64 `json:"refund"`
|
RefundCounter uint64 `json:"refund"`
|
||||||
Err error `json:"-"`
|
Err error `json:"-"`
|
||||||
OpName string `json:"opName"`
|
OpName string `json:"opName"`
|
||||||
|
|
@ -34,6 +36,7 @@ func (s StructLog) MarshalJSON() ([]byte, error) {
|
||||||
}
|
}
|
||||||
var enc StructLog
|
var enc StructLog
|
||||||
enc.Pc = s.Pc
|
enc.Pc = s.Pc
|
||||||
|
enc.Section = s.Section
|
||||||
enc.Op = s.Op
|
enc.Op = s.Op
|
||||||
enc.Gas = math.HexOrDecimal64(s.Gas)
|
enc.Gas = math.HexOrDecimal64(s.Gas)
|
||||||
enc.GasCost = math.HexOrDecimal64(s.GasCost)
|
enc.GasCost = math.HexOrDecimal64(s.GasCost)
|
||||||
|
|
@ -48,6 +51,7 @@ func (s StructLog) MarshalJSON() ([]byte, error) {
|
||||||
enc.ReturnData = s.ReturnData
|
enc.ReturnData = s.ReturnData
|
||||||
enc.Storage = s.Storage
|
enc.Storage = s.Storage
|
||||||
enc.Depth = s.Depth
|
enc.Depth = s.Depth
|
||||||
|
enc.FunctionDepth = s.FunctionDepth
|
||||||
enc.RefundCounter = s.RefundCounter
|
enc.RefundCounter = s.RefundCounter
|
||||||
enc.Err = s.Err
|
enc.Err = s.Err
|
||||||
enc.OpName = s.OpName()
|
enc.OpName = s.OpName()
|
||||||
|
|
@ -59,6 +63,7 @@ func (s StructLog) MarshalJSON() ([]byte, error) {
|
||||||
func (s *StructLog) UnmarshalJSON(input []byte) error {
|
func (s *StructLog) UnmarshalJSON(input []byte) error {
|
||||||
type StructLog struct {
|
type StructLog struct {
|
||||||
Pc *uint64 `json:"pc"`
|
Pc *uint64 `json:"pc"`
|
||||||
|
Section *uint64 `json:"section,omitempty"`
|
||||||
Op *vm.OpCode `json:"op"`
|
Op *vm.OpCode `json:"op"`
|
||||||
Gas *math.HexOrDecimal64 `json:"gas"`
|
Gas *math.HexOrDecimal64 `json:"gas"`
|
||||||
GasCost *math.HexOrDecimal64 `json:"gasCost"`
|
GasCost *math.HexOrDecimal64 `json:"gasCost"`
|
||||||
|
|
@ -68,6 +73,7 @@ func (s *StructLog) UnmarshalJSON(input []byte) error {
|
||||||
ReturnData *hexutil.Bytes `json:"returnData,omitempty"`
|
ReturnData *hexutil.Bytes `json:"returnData,omitempty"`
|
||||||
Storage map[common.Hash]common.Hash `json:"-"`
|
Storage map[common.Hash]common.Hash `json:"-"`
|
||||||
Depth *int `json:"depth"`
|
Depth *int `json:"depth"`
|
||||||
|
FunctionDepth *uint64 `json:"functionDepth,omitempty"`
|
||||||
RefundCounter *uint64 `json:"refund"`
|
RefundCounter *uint64 `json:"refund"`
|
||||||
Err error `json:"-"`
|
Err error `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
@ -78,6 +84,9 @@ func (s *StructLog) UnmarshalJSON(input []byte) error {
|
||||||
if dec.Pc != nil {
|
if dec.Pc != nil {
|
||||||
s.Pc = *dec.Pc
|
s.Pc = *dec.Pc
|
||||||
}
|
}
|
||||||
|
if dec.Section != nil {
|
||||||
|
s.Section = *dec.Section
|
||||||
|
}
|
||||||
if dec.Op != nil {
|
if dec.Op != nil {
|
||||||
s.Op = *dec.Op
|
s.Op = *dec.Op
|
||||||
}
|
}
|
||||||
|
|
@ -108,6 +117,9 @@ func (s *StructLog) UnmarshalJSON(input []byte) error {
|
||||||
if dec.Depth != nil {
|
if dec.Depth != nil {
|
||||||
s.Depth = *dec.Depth
|
s.Depth = *dec.Depth
|
||||||
}
|
}
|
||||||
|
if dec.FunctionDepth != nil {
|
||||||
|
s.FunctionDepth = *dec.FunctionDepth
|
||||||
|
}
|
||||||
if dec.RefundCounter != nil {
|
if dec.RefundCounter != nil {
|
||||||
s.RefundCounter = *dec.RefundCounter
|
s.RefundCounter = *dec.RefundCounter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue