mirror of https://github.com/ethereum/go-ethereum
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
3.2 KiB
111 lines
3.2 KiB
8 years ago
|
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
||
|
|
||
3 years ago
|
package logger
|
||
8 years ago
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
|
||
|
"github.com/ethereum/go-ethereum/common"
|
||
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
||
|
"github.com/ethereum/go-ethereum/common/math"
|
||
3 years ago
|
"github.com/ethereum/go-ethereum/core/vm"
|
||
3 years ago
|
"github.com/holiman/uint256"
|
||
8 years ago
|
)
|
||
|
|
||
7 years ago
|
var _ = (*structLogMarshaling)(nil)
|
||
|
|
||
6 years ago
|
// MarshalJSON marshals as JSON.
|
||
8 years ago
|
func (s StructLog) MarshalJSON() ([]byte, error) {
|
||
|
type StructLog struct {
|
||
6 years ago
|
Pc uint64 `json:"pc"`
|
||
3 years ago
|
Op vm.OpCode `json:"op"`
|
||
6 years ago
|
Gas math.HexOrDecimal64 `json:"gas"`
|
||
|
GasCost math.HexOrDecimal64 `json:"gasCost"`
|
||
|
Memory hexutil.Bytes `json:"memory"`
|
||
|
MemorySize int `json:"memSize"`
|
||
3 years ago
|
Stack []uint256.Int `json:"stack"`
|
||
4 years ago
|
ReturnData hexutil.Bytes `json:"returnData"`
|
||
6 years ago
|
Storage map[common.Hash]common.Hash `json:"-"`
|
||
|
Depth int `json:"depth"`
|
||
|
RefundCounter uint64 `json:"refund"`
|
||
|
Err error `json:"-"`
|
||
|
OpName string `json:"opName"`
|
||
|
ErrorString string `json:"error"`
|
||
8 years ago
|
}
|
||
|
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
|
||
7 years ago
|
enc.MemorySize = s.MemorySize
|
||
3 years ago
|
enc.Stack = s.Stack
|
||
4 years ago
|
enc.ReturnData = s.ReturnData
|
||
8 years ago
|
enc.Storage = s.Storage
|
||
|
enc.Depth = s.Depth
|
||
6 years ago
|
enc.RefundCounter = s.RefundCounter
|
||
8 years ago
|
enc.Err = s.Err
|
||
|
enc.OpName = s.OpName()
|
||
7 years ago
|
enc.ErrorString = s.ErrorString()
|
||
8 years ago
|
return json.Marshal(&enc)
|
||
|
}
|
||
|
|
||
6 years ago
|
// UnmarshalJSON unmarshals from JSON.
|
||
8 years ago
|
func (s *StructLog) UnmarshalJSON(input []byte) error {
|
||
|
type StructLog struct {
|
||
6 years ago
|
Pc *uint64 `json:"pc"`
|
||
3 years ago
|
Op *vm.OpCode `json:"op"`
|
||
6 years ago
|
Gas *math.HexOrDecimal64 `json:"gas"`
|
||
|
GasCost *math.HexOrDecimal64 `json:"gasCost"`
|
||
|
Memory *hexutil.Bytes `json:"memory"`
|
||
|
MemorySize *int `json:"memSize"`
|
||
3 years ago
|
Stack []uint256.Int `json:"stack"`
|
||
4 years ago
|
ReturnData *hexutil.Bytes `json:"returnData"`
|
||
6 years ago
|
Storage map[common.Hash]common.Hash `json:"-"`
|
||
|
Depth *int `json:"depth"`
|
||
|
RefundCounter *uint64 `json:"refund"`
|
||
|
Err error `json:"-"`
|
||
8 years ago
|
}
|
||
|
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 {
|
||
7 years ago
|
s.Memory = *dec.Memory
|
||
8 years ago
|
}
|
||
7 years ago
|
if dec.MemorySize != nil {
|
||
|
s.MemorySize = *dec.MemorySize
|
||
|
}
|
||
8 years ago
|
if dec.Stack != nil {
|
||
3 years ago
|
s.Stack = dec.Stack
|
||
8 years ago
|
}
|
||
4 years ago
|
if dec.ReturnData != nil {
|
||
4 years ago
|
s.ReturnData = *dec.ReturnData
|
||
4 years ago
|
}
|
||
8 years ago
|
if dec.Storage != nil {
|
||
|
s.Storage = dec.Storage
|
||
|
}
|
||
|
if dec.Depth != nil {
|
||
|
s.Depth = *dec.Depth
|
||
|
}
|
||
6 years ago
|
if dec.RefundCounter != nil {
|
||
|
s.RefundCounter = *dec.RefundCounter
|
||
|
}
|
||
8 years ago
|
if dec.Err != nil {
|
||
7 years ago
|
s.Err = dec.Err
|
||
8 years ago
|
}
|
||
|
return nil
|
||
|
}
|