Skip to content

Commit

Permalink
ethclient: simplify error handling in TransactionReceipt (ethereum#28748
Browse files Browse the repository at this point in the history
)


Co-authored-by: Martin HS <[email protected]>
Co-authored-by: Felix Lange <[email protected]>
  • Loading branch information
3 people authored 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.