mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
62 lines
1.5 KiB
Go
62 lines
1.5 KiB
Go
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
package native
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
"github.com/ethereum/go-ethereum/common/math"
|
|
)
|
|
|
|
var _ = (*callFrameExitMarshaling)(nil)
|
|
|
|
// MarshalJSON marshals as JSON.
|
|
func (c CallFrameExit) MarshalJSON() ([]byte, error) {
|
|
type CallFrameExit struct {
|
|
From common.Address `json:"from"`
|
|
To common.Address `json:"to"`
|
|
Output hexutil.Bytes `json:"output"`
|
|
GasUsed math.HexOrDecimal64 `json:"gasUsed"`
|
|
Error *string `json:"error,omitempty"`
|
|
}
|
|
var enc CallFrameExit
|
|
enc.From = c.From
|
|
enc.To = c.To
|
|
enc.Output = c.Output
|
|
enc.GasUsed = math.HexOrDecimal64(c.GasUsed)
|
|
enc.Error = c.Error
|
|
return json.Marshal(&enc)
|
|
}
|
|
|
|
// UnmarshalJSON unmarshals from JSON.
|
|
func (c *CallFrameExit) UnmarshalJSON(input []byte) error {
|
|
type CallFrameExit struct {
|
|
From *common.Address `json:"from"`
|
|
To *common.Address `json:"to"`
|
|
Output *hexutil.Bytes `json:"output"`
|
|
GasUsed *math.HexOrDecimal64 `json:"gasUsed"`
|
|
Error *string `json:"error,omitempty"`
|
|
}
|
|
var dec CallFrameExit
|
|
if err := json.Unmarshal(input, &dec); err != nil {
|
|
return err
|
|
}
|
|
if dec.From != nil {
|
|
c.From = *dec.From
|
|
}
|
|
if dec.To != nil {
|
|
c.To = *dec.To
|
|
}
|
|
if dec.Output != nil {
|
|
c.Output = *dec.Output
|
|
}
|
|
if dec.GasUsed != nil {
|
|
c.GasUsed = uint64(*dec.GasUsed)
|
|
}
|
|
if dec.Error != nil {
|
|
c.Error = dec.Error
|
|
}
|
|
return nil
|
|
}
|