internal/ethapi: fix missing proper error propagation, close XFN-118 (#1683)

This commit is contained in:
Daniel Liu 2025-11-03 15:20:04 +08:00 committed by GitHub
parent 737bfa45a6
commit 0f4d266b9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -531,7 +531,10 @@ func (api *BlockChainAPI) GetStorageAt(ctx context.Context, address common.Addre
// GetBlockReceipts returns the block receipts for the given block hash or number or tag.
func (api *BlockChainAPI) GetBlockReceipts(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) ([]map[string]interface{}, error) {
block, err := api.b.BlockByNumberOrHash(ctx, blockNrOrHash)
if block == nil || err != nil {
if err != nil {
return nil, err
}
if block == nil {
// When the block doesn't exist, the RPC method should return JSON null
// as per specification.
return nil, nil