Skip to content

Commit ddc083d

Browse files
kosuke-taniguchifjl
authored andcommitted
internal/ethapi: add comment explaining return of nil instead of error (ethereum#25097)
Co-authored-by: Felix Lange <[email protected]>
1 parent a4f60bd commit ddc083d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/ethapi/api.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,6 +1581,8 @@ func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context,
15811581
func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) {
15821582
tx, blockHash, blockNumber, index, err := s.b.GetTransaction(ctx, hash)
15831583
if err != nil {
1584+
// When the transaction doesn't exist, the RPC method should return JSON null
1585+
// as per specification.
15841586
return nil, nil
15851587
}
15861588
receipts, err := s.b.GetReceipts(ctx, blockHash)

0 commit comments

Comments
 (0)