internal/ethapi: return requests as hex

This commit is contained in:
Felix Lange 2024-09-12 18:18:12 +02:00
parent b3cff4ee5f
commit 57f2ad1118

View file

@ -1437,7 +1437,12 @@ func RPCMarshalBlock(block *types.Block, inclTx bool, fullTx bool, config *param
fields["withdrawals"] = block.Withdrawals() fields["withdrawals"] = block.Withdrawals()
} }
if block.Header().RequestsHash != nil { if block.Header().RequestsHash != nil {
fields["requests"] = block.Requests() // Convert requests to hex.
hexreq := make([]hexutil.Bytes, len(block.Requests()))
for i, req := range block.Requests() {
hexreq[i] = req
}
fields["requests"] = hexreq
} }
return fields return fields
} }