improve error handling

This commit is contained in:
Rossen Krastev 2023-12-30 00:30:53 +02:00 committed by GitHub
parent 09e0208029
commit c4bff96840
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -307,12 +307,13 @@ 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 err != nil {
return nil, err
}
if r == nil {
return nil, ethereum.NotFound
}
}
return r, err
return r, nil
}
// SyncProgress retrieves the current progress of the sync algorithm. If there's