Skip to content

Commit 3dc5492

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 046317a commit 3dc5492

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
@@ -1752,6 +1752,8 @@ func (s *PublicTransactionPoolAPI) GetRawTransactionByHash(ctx context.Context,
17521752
func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error) {
17531753
tx, blockHash, blockNumber, index, err := s.b.GetTransaction(ctx, hash)
17541754
if err != nil {
1755+
// When the transaction doesn't exist, the RPC method should return JSON null
1756+
// as per specification.
17551757
return nil, nil
17561758
}
17571759
receipts, err := s.b.GetReceipts(ctx, blockHash)

0 commit comments

Comments
 (0)