Skip to content

Commit

Permalink
ethclient: simplify error handling in TransactionReceipt (#28748)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin HS <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
  • Loading branch information
3 people committed Jan 4, 2024
1 parent 99eb49e commit e3eeb64
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ethclient/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,8 @@ func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash,
func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) {
var r *types.Receipt
err := ec.c.CallContext(ctx, &r, "eth_getTransactionReceipt", txHash)
if err == nil {
if r == nil {
return nil, ethereum.NotFound
}
if err == nil && r == nil {
return nil, ethereum.NotFound
}
return r, err
}
Expand Down

0 comments on commit e3eeb64

Please sign in to comment.