Skip to content

Commit

Permalink
fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
golangisfun123 committed Oct 10, 2024
1 parent 9dc780d commit 543fa15
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions contrib/opbot/internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ func (r *rfqClientImpl) GetRFQByTxID(ctx context.Context, txID string) (*GetRFQB

// GetRFQByTxHash gets a quote request by transaction hash.
func (r *rfqClientImpl) GetRFQByTxHash(ctx context.Context, txHash string) (*relapi.GetQuoteRequestResponse, error) {
var resp *relapi.GetQuoteRequestResponse
var err error
var errs []error
for _, relayerClient := range r.relayerClients {
resp, err = relayerClient.GetQuoteRequestByTxHash(ctx, txHash)
if err != nil {
return nil, fmt.Errorf("failed to get quote request by tx hash: %w", err)
resp, err := relayerClient.GetQuoteRequestByTxHash(ctx, txHash)
if err == nil {
return resp, nil
}
errs = append(errs, fmt.Errorf("could not get quote request by tx hash: %w", err))
}

return resp, nil
return nil, fmt.Errorf("could not get quote request by tx hash: %v", errs)
}

var _ RFQClient = &rfqClientImpl{}

0 comments on commit 543fa15

Please sign in to comment.