2023-01-25 17:32:25 +03:00
|
|
|
// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
|
|
|
|
|
2023-02-06 18:37:58 +03:00
|
|
|
package engine
|
2023-01-25 17:32:25 +03:00
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
"errors"
|
|
|
|
"math/big"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ = (*executionPayloadEnvelopeMarshaling)(nil)
|
|
|
|
|
|
|
|
// MarshalJSON marshals as JSON.
|
|
|
|
func (e ExecutionPayloadEnvelope) MarshalJSON() ([]byte, error) {
|
|
|
|
type ExecutionPayloadEnvelope struct {
|
|
|
|
ExecutionPayload *ExecutableData `json:"executionPayload" gencodec:"required"`
|
|
|
|
BlockValue *hexutil.Big `json:"blockValue" gencodec:"required"`
|
2023-07-18 10:44:16 +03:00
|
|
|
BlobsBundle *BlobsBundleV1 `json:"blobsBundle"`
|
2023-09-04 16:26:13 +03:00
|
|
|
Override bool `json:"shouldOverrideBuilder"`
|
2023-01-25 17:32:25 +03:00
|
|
|
}
|
|
|
|
var enc ExecutionPayloadEnvelope
|
|
|
|
enc.ExecutionPayload = e.ExecutionPayload
|
|
|
|
enc.BlockValue = (*hexutil.Big)(e.BlockValue)
|
2023-07-18 10:44:16 +03:00
|
|
|
enc.BlobsBundle = e.BlobsBundle
|
2023-09-04 16:26:13 +03:00
|
|
|
enc.Override = e.Override
|
2023-01-25 17:32:25 +03:00
|
|
|
return json.Marshal(&enc)
|
|
|
|
}
|
|
|
|
|
|
|
|
// UnmarshalJSON unmarshals from JSON.
|
|
|
|
func (e *ExecutionPayloadEnvelope) UnmarshalJSON(input []byte) error {
|
|
|
|
type ExecutionPayloadEnvelope struct {
|
|
|
|
ExecutionPayload *ExecutableData `json:"executionPayload" gencodec:"required"`
|
|
|
|
BlockValue *hexutil.Big `json:"blockValue" gencodec:"required"`
|
2023-07-18 10:44:16 +03:00
|
|
|
BlobsBundle *BlobsBundleV1 `json:"blobsBundle"`
|
2023-09-04 16:26:13 +03:00
|
|
|
Override *bool `json:"shouldOverrideBuilder"`
|
2023-01-25 17:32:25 +03:00
|
|
|
}
|
|
|
|
var dec ExecutionPayloadEnvelope
|
|
|
|
if err := json.Unmarshal(input, &dec); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if dec.ExecutionPayload == nil {
|
|
|
|
return errors.New("missing required field 'executionPayload' for ExecutionPayloadEnvelope")
|
|
|
|
}
|
|
|
|
e.ExecutionPayload = dec.ExecutionPayload
|
|
|
|
if dec.BlockValue == nil {
|
|
|
|
return errors.New("missing required field 'blockValue' for ExecutionPayloadEnvelope")
|
|
|
|
}
|
|
|
|
e.BlockValue = (*big.Int)(dec.BlockValue)
|
2023-07-18 10:44:16 +03:00
|
|
|
if dec.BlobsBundle != nil {
|
|
|
|
e.BlobsBundle = dec.BlobsBundle
|
|
|
|
}
|
2023-09-04 16:26:13 +03:00
|
|
|
if dec.Override != nil {
|
|
|
|
e.Override = *dec.Override
|
|
|
|
}
|
2023-01-25 17:32:25 +03:00
|
|
|
return nil
|
|
|
|
}
|