internal/ethapi: add comment explaining return of nil instead of error (#25097)

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
Kosuke Taniguchi 2022-06-17 00:08:25 +09:00 committed by GitHub
parent 67454df08b
commit ba99e19215
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1581,6 +1581,8 @@ func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context,
func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) {
tx, blockHash, blockNumber, index, err := s.b.GetTransaction(ctx, hash)
if err != nil {
// When the transaction doesn't exist, the RPC method should return JSON null
// as per specification.
return nil, nil
}
receipts, err := s.b.GetReceipts(ctx, blockHash)