2022-09-26 18:35:44 +02:00
|
|
|
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
|
|
|
|
package native
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"math/big"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
|
|
"github.com/ethereum/go-ethereum/core/vm"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ = (*callFrameMarshaling)(nil)
|
|
|
|
|
|
|
|
// MarshalJSON marshals as JSON.
|
|
|
|
func (c callFrame) MarshalJSON() ([]byte, error) {
|
|
|
|
type callFrame0 struct {
|
2023-03-07 17:09:11 +03:30
|
|
|
Type vm.OpCode `json:"-"`
|
|
|
|
From common.Address `json:"from"`
|
|
|
|
Gas hexutil.Uint64 `json:"gas"`
|
|
|
|
GasUsed hexutil.Uint64 `json:"gasUsed"`
|
|
|
|
To *common.Address `json:"to,omitempty" rlp:"optional"`
|
|
|
|
Input hexutil.Bytes `json:"input" rlp:"optional"`
|
|
|
|
Output hexutil.Bytes `json:"output,omitempty" rlp:"optional"`
|
|
|
|
Error string `json:"error,omitempty" rlp:"optional"`
|
|
|
|
RevertReason string `json:"revertReason,omitempty"`
|
|
|
|
Calls []callFrame `json:"calls,omitempty" rlp:"optional"`
|
|
|
|
Logs []callLog `json:"logs,omitempty" rlp:"optional"`
|
|
|
|
Value *hexutil.Big `json:"value,omitempty" rlp:"optional"`
|
|
|
|
TypeString string `json:"type"`
|
2022-09-26 18:35:44 +02:00
|
|
|
}
|
|
|
|
var enc callFrame0
|
|
|
|
enc.Type = c.Type
|
|
|
|
enc.From = c.From
|
|
|
|
enc.Gas = hexutil.Uint64(c.Gas)
|
|
|
|
enc.GasUsed = hexutil.Uint64(c.GasUsed)
|
2022-09-29 04:36:07 -05:00
|
|
|
enc.To = c.To
|
2022-09-26 18:35:44 +02:00
|
|
|
enc.Input = c.Input
|
|
|
|
enc.Output = c.Output
|
|
|
|
enc.Error = c.Error
|
2023-01-31 16:29:17 +08:00
|
|
|
enc.RevertReason = c.RevertReason
|
2022-09-26 18:35:44 +02:00
|
|
|
enc.Calls = c.Calls
|
2022-11-01 19:03:26 +08:00
|
|
|
enc.Logs = c.Logs
|
2022-09-26 18:35:44 +02:00
|
|
|
enc.Value = (*hexutil.Big)(c.Value)
|
|
|
|
enc.TypeString = c.TypeString()
|
|
|
|
return json.Marshal(&enc)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalJSON unmarshals from JSON.
|
|
|
|
func (c *callFrame) UnmarshalJSON(input []byte) error {
|
|
|
|
type callFrame0 struct {
|
2023-01-31 16:29:17 +08:00
|
|
|
Type *vm.OpCode `json:"-"`
|
|
|
|
From *common.Address `json:"from"`
|
|
|
|
Gas *hexutil.Uint64 `json:"gas"`
|
|
|
|
GasUsed *hexutil.Uint64 `json:"gasUsed"`
|
|
|
|
To *common.Address `json:"to,omitempty" rlp:"optional"`
|
|
|
|
Input *hexutil.Bytes `json:"input" rlp:"optional"`
|
|
|
|
Output *hexutil.Bytes `json:"output,omitempty" rlp:"optional"`
|
|
|
|
Error *string `json:"error,omitempty" rlp:"optional"`
|
|
|
|
RevertReason *string `json:"revertReason,omitempty"`
|
|
|
|
Calls []callFrame `json:"calls,omitempty" rlp:"optional"`
|
|
|
|
Logs []callLog `json:"logs,omitempty" rlp:"optional"`
|
|
|
|
Value *hexutil.Big `json:"value,omitempty" rlp:"optional"`
|
2022-09-26 18:35:44 +02:00
|
|
|
}
|
|
|
|
var dec callFrame0
|
|
|
|
if err := json.Unmarshal(input, &dec); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if dec.Type != nil {
|
|
|
|
c.Type = *dec.Type
|
|
|
|
}
|
|
|
|
if dec.From != nil {
|
|
|
|
c.From = *dec.From
|
|
|
|
}
|
|
|
|
if dec.Gas != nil {
|
|
|
|
c.Gas = uint64(*dec.Gas)
|
|
|
|
}
|
|
|
|
if dec.GasUsed != nil {
|
|
|
|
c.GasUsed = uint64(*dec.GasUsed)
|
|
|
|
}
|
2022-09-29 04:36:07 -05:00
|
|
|
if dec.To != nil {
|
2023-03-07 17:09:11 +03:30
|
|
|
c.To = dec.To
|
2022-09-29 04:36:07 -05:00
|
|
|
}
|
2022-09-26 18:35:44 +02:00
|
|
|
if dec.Input != nil {
|
|
|
|
c.Input = *dec.Input
|
|
|
|
}
|
|
|
|
if dec.Output != nil {
|
|
|
|
c.Output = *dec.Output
|
|
|
|
}
|
|
|
|
if dec.Error != nil {
|
|
|
|
c.Error = *dec.Error
|
|
|
|
}
|
2023-01-31 16:29:17 +08:00
|
|
|
if dec.RevertReason != nil {
|
|
|
|
c.RevertReason = *dec.RevertReason
|
2022-09-29 04:36:07 -05:00
|
|
|
}
|
2022-09-26 18:35:44 +02:00
|
|
|
if dec.Calls != nil {
|
|
|
|
c.Calls = dec.Calls
|
|
|
|
}
|
2022-11-01 19:03:26 +08:00
|
|
|
if dec.Logs != nil {
|
|
|
|
c.Logs = dec.Logs
|
|
|
|
}
|
2022-09-26 18:35:44 +02:00
|
|
|
if dec.Value != nil {
|
|
|
|
c.Value = (*big.Int)(dec.Value)
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|