Skip to content

Commit e3eeb64

Browse files
rosenkholimanfjl
authored
ethclient: simplify error handling in TransactionReceipt (#28748)
Co-authored-by: Martin HS <[email protected]> Co-authored-by: Felix Lange <[email protected]>
1 parent 99eb49e commit e3eeb64

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ethclient/ethclient.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,8 @@ func (ec *Client) TransactionInBlock(ctx context.Context, blockHash common.Hash,
307307
func (ec *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) {
308308
var r *types.Receipt
309309
err := ec.c.CallContext(ctx, &r, "eth_getTransactionReceipt", txHash)
310-
if err == nil {
311-
if r == nil {
312-
return nil, ethereum.NotFound
313-
}
310+
if err == nil && r == nil {
311+
return nil, ethereum.NotFound
314312
}
315313
return r, err
316314
}

0 commit comments

Comments
 (0)