core/types, internal/ethapi: rename requestsRoot -> requestsHash in JSON

This commit is contained in:
Felix Lange 2024-12-17 17:07:50 +01:00
parent 13a6cd4ef3
commit 59732d1209
3 changed files with 4 additions and 4 deletions

View file

@ -105,7 +105,7 @@ type Header struct {
ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"`
// RequestsHash was added by EIP-7685 and is ignored in legacy headers.
RequestsHash *common.Hash `json:"requestsRoot" rlp:"optional"`
RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"`
}
// field type overrides for gencodec

View file

@ -36,7 +36,7 @@ func (h Header) MarshalJSON() ([]byte, error) {
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed" rlp:"optional"`
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas" rlp:"optional"`
ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"`
RequestsHash *common.Hash `json:"requestsRoot" rlp:"optional"`
RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"`
Hash common.Hash `json:"hash"`
}
var enc Header
@ -88,7 +88,7 @@ func (h *Header) UnmarshalJSON(input []byte) error {
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed" rlp:"optional"`
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas" rlp:"optional"`
ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"`
RequestsHash *common.Hash `json:"requestsRoot" rlp:"optional"`
RequestsHash *common.Hash `json:"requestsHash" rlp:"optional"`
}
var dec Header
if err := json.Unmarshal(input, &dec); err != nil {

View file

@ -895,7 +895,7 @@ func RPCMarshalHeader(head *types.Header) map[string]interface{} {
result["parentBeaconBlockRoot"] = head.ParentBeaconRoot
}
if head.RequestsHash != nil {
result["requestsRoot"] = head.RequestsHash
result["requestsHash"] = head.RequestsHash
}
return result
}