Skip to content

Commit

Permalink
Fix payload attributes json (#12169)
Browse files Browse the repository at this point in the history
Co-authored-by: terencechain <terence@prysmaticlabs.com>
  • Loading branch information
avalonche and terencechain authored Mar 21, 2023
1 parent 88f0396 commit 4d5827c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/rpc/apimiddleware/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ type EventPayloadAttributeV2Json struct {
ParentBlockNumber string `json:"parent_block_number"`
ParentBlockRoot string `json:"parent_block_root" hex:"true"`
ParentBlockHash string `json:"parent_block_hash" hex:"true"`
PayloadAttributes *PayloadAttributesV2Json `json:"payload_attributes_v2"`
PayloadAttributes *PayloadAttributesV2Json `json:"payload_attributes"`
}

type PayloadAttributesV1Json struct {
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/eth/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func (s *Server) streamPayloadAttributes(stream ethpbservice.Events_StreamEvents
ParentBlockNumber: headPayload.BlockNumber(),
ParentBlockRoot: headRoot,
ParentBlockHash: headPayload.BlockHash(),
PayloadAttributesV2: &enginev1.PayloadAttributesV2{
PayloadAttributes: &enginev1.PayloadAttributesV2{
Timestamp: uint64(t.Unix()),
PrevRandao: prevRando,
SuggestedFeeRecipient: headPayload.FeeRecipient(),
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/eth/events/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ func TestStreamEvents_StateEvents(t *testing.T) {
ParentBlockNumber: 1,
ParentBlockRoot: make([]byte, 32),
ParentBlockHash: make([]byte, 32),
PayloadAttributesV2: &enginev1.PayloadAttributesV2{
PayloadAttributes: &enginev1.PayloadAttributesV2{
Timestamp: 24,
PrevRandao: prevRando,
SuggestedFeeRecipient: make([]byte, 20),
Expand Down
50 changes: 25 additions & 25 deletions proto/eth/v1/events.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/eth/v1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,6 @@ message EventPayloadAttributeV2 {
// The version N must match the payload attributes for the hard fork matching version.
// The beacon API encoded object must have equivalent fields to its counterpart in execution-apis with two differences:
// 1) snake_case identifiers must be used rather than camelCase; 2) integers must be encoded as quoted decimals rather than big-endian hex.
engine.v1.PayloadAttributesV2 payload_attributes_v2 = 8;
engine.v1.PayloadAttributesV2 payload_attributes = 8;
}
}

0 comments on commit 4d5827c

Please sign in to comment.