Skip to content

Commit

Permalink
Cleanup: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasse committed Oct 2, 2024
1 parent 04ff76b commit 3324e53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions services/rfq/api/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func (c *clientImpl) processWebsocket(ctx context.Context, conn *websocket.Conn,
}
}

func (c *clientImpl) sendPings(ctx context.Context, reqChan chan *model.ActiveRFQMessage) (err error) {
func (c *clientImpl) sendPings(ctx context.Context, reqChan chan *model.ActiveRFQMessage) {
pingTicker := time.NewTicker(pingPeriod)
defer pingTicker.Stop()

Expand All @@ -308,7 +308,7 @@ func (c *clientImpl) sendPings(ctx context.Context, reqChan chan *model.ActiveRF
}
reqChan <- &pingMsg
case <-ctx.Done():
return nil
return
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions services/rfq/api/rest/rfq.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (r *QuoterAPIServer) handleActiveRFQ(ctx context.Context, request *model.Pu
responses := r.collectRelayerResponses(ctx, request, requestID)
for r, resp := range responses {
relayerAddr := r
quote, _ = getBestQuote(quote, getRelayerQuoteData(request, resp))
quote = getBestQuote(quote, getRelayerQuoteData(request, resp))
quote.RelayerAddress = &relayerAddr
}
err = r.recordActiveQuote(ctx, quote, requestID)
Expand Down Expand Up @@ -156,22 +156,22 @@ func getRelayerQuoteData(request *model.PutRFQRequest, resp *model.WsRFQResponse
}
}

func getBestQuote(a, b *model.QuoteData) (*model.QuoteData, bool) {
func getBestQuote(a, b *model.QuoteData) *model.QuoteData {
if a == nil && b == nil {
return nil, false
return nil
}
if a == nil {
return b, true
return b
}
if b == nil {
return a, false
return a
}
aAmount, _ := new(big.Int).SetString(*a.DestAmount, 10)
bAmount, _ := new(big.Int).SetString(*b.DestAmount, 10)
if aAmount.Cmp(bAmount) > 0 {
return a, false
return a
}
return b, true
return b
}

func getQuoteResponseStatus(ctx context.Context, resp *model.WsRFQResponse) db.ActiveQuoteResponseStatus {
Expand Down Expand Up @@ -265,7 +265,7 @@ func (r *QuoterAPIServer) handlePassiveRFQ(ctx context.Context, request *model.P
DestAmount: &destAmount,
RelayerAddress: &quote.RelayerAddr,
}
bestQuote, _ = getBestQuote(bestQuote, quoteData)
bestQuote = getBestQuote(bestQuote, quoteData)
}

return bestQuote, nil
Expand Down

0 comments on commit 3324e53

Please sign in to comment.