Skip to content

Commit

Permalink
deep source lint about type/method order
Browse files Browse the repository at this point in the history
  • Loading branch information
kasey committed May 11, 2024
1 parent 8fe64c5 commit 53343c9
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions proto/engine/v1/json_marshal_unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,38 @@ type GetPayloadV4ResponseJson struct {
ShouldOverrideBuilder bool `json:"shouldOverrideBuilder"`
}

// ExecutionPayloadElectraJSON represents the engine API ExecutionPayloadV4 type.
type ExecutionPayloadElectraJSON struct {
ParentHash *common.Hash `json:"parentHash"`
FeeRecipient *common.Address `json:"feeRecipient"`
StateRoot *common.Hash `json:"stateRoot"`
ReceiptsRoot *common.Hash `json:"receiptsRoot"`
LogsBloom *hexutil.Bytes `json:"logsBloom"`
PrevRandao *common.Hash `json:"prevRandao"`
BlockNumber *hexutil.Uint64 `json:"blockNumber"`
GasLimit *hexutil.Uint64 `json:"gasLimit"`
GasUsed *hexutil.Uint64 `json:"gasUsed"`
Timestamp *hexutil.Uint64 `json:"timestamp"`
ExtraData hexutil.Bytes `json:"extraData"`
BaseFeePerGas string `json:"baseFeePerGas"`
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"`
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"`
BlockHash *common.Hash `json:"blockHash"`
Transactions []hexutil.Bytes `json:"transactions"`
Withdrawals []*Withdrawal `json:"withdrawals"`
WithdrawalRequests []WithdrawalRequestV1 `json:"withdrawalRequests"`
DepositRequests []DepositRequestV1 `json:"depositRequests"`
}

// Validate returns an error if key fields in GetPayloadV4ResponseJson are nil or invalid.
func (j *GetPayloadV4ResponseJson) Validate() error {
if j.ExecutionPayload == nil {
return errors.New("nil ExecutionPayload")
}
return j.ExecutionPayload.Validate()
}

// Validate returns an error if key fields in ExecutionPayloadElectraJSON are nil or invalid.
func (j *ExecutionPayloadElectraJSON) Validate() error {
if j.ParentHash == nil {
return errors.New("missing required field 'parentHash' for ExecutionPayload")
Expand Down Expand Up @@ -378,29 +403,6 @@ type ExecutionPayloadDenebJSON struct {
Withdrawals []*Withdrawal `json:"withdrawals"`
}

// ExecutionPayloadElectraJSON represents the engine API ExecutionPayloadV4 type.
type ExecutionPayloadElectraJSON struct {
ParentHash *common.Hash `json:"parentHash"`
FeeRecipient *common.Address `json:"feeRecipient"`
StateRoot *common.Hash `json:"stateRoot"`
ReceiptsRoot *common.Hash `json:"receiptsRoot"`
LogsBloom *hexutil.Bytes `json:"logsBloom"`
PrevRandao *common.Hash `json:"prevRandao"`
BlockNumber *hexutil.Uint64 `json:"blockNumber"`
GasLimit *hexutil.Uint64 `json:"gasLimit"`
GasUsed *hexutil.Uint64 `json:"gasUsed"`
Timestamp *hexutil.Uint64 `json:"timestamp"`
ExtraData hexutil.Bytes `json:"extraData"`
BaseFeePerGas string `json:"baseFeePerGas"`
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"`
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"`
BlockHash *common.Hash `json:"blockHash"`
Transactions []hexutil.Bytes `json:"transactions"`
Withdrawals []*Withdrawal `json:"withdrawals"`
WithdrawalRequests []WithdrawalRequestV1 `json:"withdrawalRequests"`
DepositRequests []DepositRequestV1 `json:"depositRequests"`
}

// WithdrawalRequestV1 represents an execution engine WithdrawalRequestV1 value
// https://github.com/ethereum/execution-apis/blob/main/src/engine/prague.md#withdrawalrequestv1
type WithdrawalRequestV1 struct {
Expand Down

0 comments on commit 53343c9

Please sign in to comment.