mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 19:00:46 +00:00
beacon/engine, eth/catalyst: encode payload body access lists
This commit is contained in:
parent
06b23b4293
commit
788dea42d4
3 changed files with 9 additions and 3 deletions
|
|
@ -440,7 +440,7 @@ type ExecutionPayloadBody struct {
|
|||
// ExecutionPayloadBodyV2 extends ExecutionPayloadBody with the block access list.
|
||||
type ExecutionPayloadBodyV2 struct {
|
||||
ExecutionPayloadBody
|
||||
BlockAccessList *bal.BlockAccessList `json:"blockAccessList"`
|
||||
BlockAccessList *hexutil.Bytes `json:"blockAccessList"`
|
||||
}
|
||||
|
||||
// Client identifiers to support ClientVersionV1.
|
||||
|
|
|
|||
|
|
@ -1320,9 +1320,15 @@ func getBodyV2(block *types.Block) *engine.ExecutionPayloadBodyV2 {
|
|||
if body == nil {
|
||||
return nil
|
||||
}
|
||||
var blockAccessList *hexutil.Bytes
|
||||
if accessList := block.AccessList(); accessList != nil {
|
||||
encoded, _ := rlp.EncodeToBytes(accessList)
|
||||
data := hexutil.Bytes(encoded)
|
||||
blockAccessList = &data
|
||||
}
|
||||
return &engine.ExecutionPayloadBodyV2{
|
||||
ExecutionPayloadBody: *body,
|
||||
BlockAccessList: block.AccessList(),
|
||||
BlockAccessList: blockAccessList,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1594,7 +1594,7 @@ func TestGetPayloadBodyV2BlockAccessList(t *testing.T) {
|
|||
name: "retained empty BAL",
|
||||
header: &types.Header{BlockAccessListHash: &emptyHash},
|
||||
accessList: &empty,
|
||||
want: "[]",
|
||||
want: `"0xc0"`,
|
||||
},
|
||||
{
|
||||
name: "pruned BAL",
|
||||
|
|
|
|||
Loading…
Reference in a new issue