2017-06-07 18:09:08 +03:00
|
|
|
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
|
2021-11-25 15:17:09 +03:00
|
|
|
package logger
|
2017-06-07 18:09:08 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
2022-07-05 06:14:21 +03:00
|
|
|
"github.com/holiman/uint256"
|
|
|
|
|
2017-06-07 18:09:08 +03:00
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
|
|
"github.com/ethereum/go-ethereum/common/math"
|
2021-11-25 15:17:09 +03:00
|
|
|
"github.com/ethereum/go-ethereum/core/vm"
|
2017-06-07 18:09:08 +03:00
|
|
|
)
|
|
|
|
|
2018-01-08 15:15:57 +03:00
|
|
|
var _ = (*structLogMarshaling)(nil)
|
|
|
|
|
2018-10-23 17:28:18 +03:00
|
|
|
// MarshalJSON marshals as JSON.
|
2017-06-07 18:09:08 +03:00
|
|
|
func (s StructLog) MarshalJSON() ([]byte, error) {
|
|
|
|
type StructLog struct {
|
2018-10-23 17:28:18 +03:00
|
|
|
Pc uint64 `json:"pc"`
|
2021-11-25 15:17:09 +03:00
|
|
|
Op vm.OpCode `json:"op"`
|
2018-10-23 17:28:18 +03:00
|
|
|
Gas math.HexOrDecimal64 `json:"gas"`
|
|
|
|
GasCost math.HexOrDecimal64 `json:"gasCost"`
|
2022-03-29 23:36:55 +03:00
|
|
|
Memory hexutil.Bytes `json:"memory,omitempty"`
|
2018-10-23 17:28:18 +03:00
|
|
|
MemorySize int `json:"memSize"`
|
2021-07-01 10:15:04 +03:00
|
|
|
Stack []uint256.Int `json:"stack"`
|
2022-03-29 23:36:55 +03:00
|
|
|
ReturnData hexutil.Bytes `json:"returnData,omitempty"`
|
2018-10-23 17:28:18 +03:00
|
|
|
Storage map[common.Hash]common.Hash `json:"-"`
|
|
|
|
Depth int `json:"depth"`
|
|
|
|
RefundCounter uint64 `json:"refund"`
|
|
|
|
Err error `json:"-"`
|
|
|
|
OpName string `json:"opName"`
|
2022-03-29 23:36:55 +03:00
|
|
|
ErrorString string `json:"error,omitempty"`
|
2017-06-07 18:09:08 +03:00
|
|
|
}
|
|
|
|
var enc StructLog
|
|
|
|
enc.Pc = s.Pc
|
|
|
|
enc.Op = s.Op
|
|
|
|
enc.Gas = math.HexOrDecimal64(s.Gas)
|
|
|
|
enc.GasCost = math.HexOrDecimal64(s.GasCost)
|
|
|
|
enc.Memory = s.Memory
|
2017-06-21 15:52:31 +03:00
|
|
|
enc.MemorySize = s.MemorySize
|
2021-07-01 10:15:04 +03:00
|
|
|
enc.Stack = s.Stack
|
2020-07-16 15:06:19 +03:00
|
|
|
enc.ReturnData = s.ReturnData
|
2017-06-07 18:09:08 +03:00
|
|
|
enc.Storage = s.Storage
|
|
|
|
enc.Depth = s.Depth
|
2018-10-23 17:28:18 +03:00
|
|
|
enc.RefundCounter = s.RefundCounter
|
2017-06-07 18:09:08 +03:00
|
|
|
enc.Err = s.Err
|
|
|
|
enc.OpName = s.OpName()
|
2018-01-08 15:15:57 +03:00
|
|
|
enc.ErrorString = s.ErrorString()
|
2017-06-07 18:09:08 +03:00
|
|
|
return json.Marshal(&enc)
|
|
|
|
}
|
|
|
|
|
2018-10-23 17:28:18 +03:00
|
|
|
// UnmarshalJSON unmarshals from JSON.
|
2017-06-07 18:09:08 +03:00
|
|
|
func (s *StructLog) UnmarshalJSON(input []byte) error {
|
|
|
|
type StructLog struct {
|
2018-10-23 17:28:18 +03:00
|
|
|
Pc *uint64 `json:"pc"`
|
2021-11-25 15:17:09 +03:00
|
|
|
Op *vm.OpCode `json:"op"`
|
2018-10-23 17:28:18 +03:00
|
|
|
Gas *math.HexOrDecimal64 `json:"gas"`
|
|
|
|
GasCost *math.HexOrDecimal64 `json:"gasCost"`
|
2022-03-29 23:36:55 +03:00
|
|
|
Memory *hexutil.Bytes `json:"memory,omitempty"`
|
2018-10-23 17:28:18 +03:00
|
|
|
MemorySize *int `json:"memSize"`
|
2021-07-01 10:15:04 +03:00
|
|
|
Stack []uint256.Int `json:"stack"`
|
2022-03-29 23:36:55 +03:00
|
|
|
ReturnData *hexutil.Bytes `json:"returnData,omitempty"`
|
2018-10-23 17:28:18 +03:00
|
|
|
Storage map[common.Hash]common.Hash `json:"-"`
|
|
|
|
Depth *int `json:"depth"`
|
|
|
|
RefundCounter *uint64 `json:"refund"`
|
|
|
|
Err error `json:"-"`
|
2017-06-07 18:09:08 +03:00
|
|
|
}
|
|
|
|
var dec StructLog
|
|
|
|
if err := json.Unmarshal(input, &dec); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if dec.Pc != nil {
|
|
|
|
s.Pc = *dec.Pc
|
|
|
|
}
|
|
|
|
if dec.Op != nil {
|
|
|
|
s.Op = *dec.Op
|
|
|
|
}
|
|
|
|
if dec.Gas != nil {
|
|
|
|
s.Gas = uint64(*dec.Gas)
|
|
|
|
}
|
|
|
|
if dec.GasCost != nil {
|
|
|
|
s.GasCost = uint64(*dec.GasCost)
|
|
|
|
}
|
|
|
|
if dec.Memory != nil {
|
2018-01-08 16:13:22 +03:00
|
|
|
s.Memory = *dec.Memory
|
2017-06-07 18:09:08 +03:00
|
|
|
}
|
2017-06-21 15:52:31 +03:00
|
|
|
if dec.MemorySize != nil {
|
|
|
|
s.MemorySize = *dec.MemorySize
|
|
|
|
}
|
2017-06-07 18:09:08 +03:00
|
|
|
if dec.Stack != nil {
|
2021-07-01 10:15:04 +03:00
|
|
|
s.Stack = dec.Stack
|
2017-06-07 18:09:08 +03:00
|
|
|
}
|
2020-07-16 15:06:19 +03:00
|
|
|
if dec.ReturnData != nil {
|
2020-10-16 12:28:03 +03:00
|
|
|
s.ReturnData = *dec.ReturnData
|
2020-07-16 15:06:19 +03:00
|
|
|
}
|
2017-06-07 18:09:08 +03:00
|
|
|
if dec.Storage != nil {
|
|
|
|
s.Storage = dec.Storage
|
|
|
|
}
|
|
|
|
if dec.Depth != nil {
|
|
|
|
s.Depth = *dec.Depth
|
|
|
|
}
|
2018-10-23 17:28:18 +03:00
|
|
|
if dec.RefundCounter != nil {
|
|
|
|
s.RefundCounter = *dec.RefundCounter
|
|
|
|
}
|
2017-06-07 18:09:08 +03:00
|
|
|
if dec.Err != nil {
|
2018-01-08 15:15:57 +03:00
|
|
|
s.Err = dec.Err
|
2017-06-07 18:09:08 +03:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|