ethclient: simplify error handling in TransactionReceipt (#28748)
Co-authored-by: Martin HS <martin@swende.se> Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
parent
99eb49e601
commit
e3eeb64c94
|
@ -307,11 +307,9 @@ 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 {
|
||||
if err == nil && r == nil {
|
||||
return nil, ethereum.NotFound
|
||||
}
|
||||
}
|
||||
return r, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue