Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yiweichi committed Oct 8, 2024
1 parent 3900ed8 commit 859195e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rollup/internal/controller/relayer/l2_relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (r *Layer2Relayer) ProcessGasPriceOracle() {
if err != nil {
log.Error("Failed to get gas token exchange rate from Binance api", "tokenSymbolPair", r.cfg.GasOracleConfig.AlternativeGasTokenConfig.TokenSymbolPair, "err", err)
}

default:
log.Error("Invalid alternative gas token mode", "mode", r.cfg.GasOracleConfig.AlternativeGasTokenConfig.Mode)
return
Expand Down
14 changes: 7 additions & 7 deletions rollup/internal/utils/exchange_rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ func GetExchangeRateFromBinanceApi(tokenSymbolPair string) (float64, error) {
if err != nil {
return 0, fmt.Errorf("error making HTTP request: %w", err)
}
defer func() {
err = resp.Body.Close()
if err != nil {
fmt.Println("error closing response body:", err)
}
}()
defer func() {
err = resp.Body.Close()
if err != nil {
fmt.Println("error closing response body:", err)
}
}()

// check for successful response
if resp.StatusCode != http.StatusOK {
Expand All @@ -49,7 +49,7 @@ func GetExchangeRateFromBinanceApi(tokenSymbolPair string) (float64, error) {
price, err := strconv.ParseFloat(data.Price, 64)
if err != nil {
return 0, fmt.Errorf("error parsing price string: %w", err)
}
}

return price, nil
}
2 changes: 1 addition & 1 deletion rollup/internal/utils/exchange_rate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ func TestGetExchangeRateFromBinanceApi(t *testing.T) {
if err != nil {
t.Fatalf("Error getting exchange rate from Binance API: %v", err)
}
}
}

0 comments on commit 859195e

Please sign in to comment.