Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Warehime committed Feb 24, 2024
1 parent 5cdd35f commit 3a8ebec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
1 change: 0 additions & 1 deletion protocol/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,6 @@ func New(
logger,
)
}

}

// Start Bridge Daemon.
Expand Down
6 changes: 4 additions & 2 deletions protocol/daemons/slinky/client/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package client
import "time"

var (
// SlinkyPriceServerConnectionTimeout controls the timeout of establishing a grpc connection to the pricefeed server.
// SlinkyPriceServerConnectionTimeout controls the timeout of establishing a
// grpc connection to the pricefeed server.
SlinkyPriceServerConnectionTimeout = time.Second * 5
// SlinkyPriceFetchDelay controls the frequency at which we pull prices from slinky and push them to the pricefeed server.
// SlinkyPriceFetchDelay controls the frequency at which we pull prices from slinky and push
// them to the pricefeed server.
SlinkyPriceFetchDelay = time.Second * 2
// SlinkyMarketParamFetchDelay is the frequency at which we query the x/price module to refresh mappings from
// currency pair to x/price ID.
Expand Down
6 changes: 4 additions & 2 deletions protocol/daemons/slinky/client/market_pair_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ func NewMarketPairFetcher(logger log.Logger) *MarketPairFetcher {
}

// Start opens the grpc connections for the fetcher.
func (m *MarketPairFetcher) Start(ctx context.Context, appFlags appflags.Flags, grpcClient daemontypes.GrpcClient) error {
func (m *MarketPairFetcher) Start(
ctx context.Context,
appFlags appflags.Flags,
grpcClient daemontypes.GrpcClient) error {
// Create the query client connection
queryConn, err := grpcClient.NewTcpConnection(ctx, appFlags.GrpcAddress)
if err != nil {
Expand All @@ -55,7 +58,6 @@ func (m *MarketPairFetcher) Stop() {
if m.queryConn != nil {
_ = m.queryConn.Close()
}
return
}

// GetIDForPair returns the ID corresponding to the currency pair in the x/prices module.
Expand Down
12 changes: 8 additions & 4 deletions protocol/daemons/slinky/client/price_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,16 @@ func (p *PriceFetcher) FetchPrices(ctx context.Context) error {
if err != nil {
return err
}
p.logger.Info("turned price pair to currency pair", "string", currencyPairString, "currency pair", currencyPair.String())
p.logger.Info("turned price pair to currency pair",
"string", currencyPairString,
"currency pair", currencyPair.String())

// get the market id for the currency pair
id, err := p.marketPairFetcher.GetIDForPair(currencyPair)
if err != nil {
p.logger.Info("slinky client returned currency pair not found in MarketPairFetcher", "currency pair", currencyPairString, "error", err)
p.logger.Info("slinky client returned currency pair not found in MarketPairFetcher",
"currency pair", currencyPairString,
"error", err)
continue
}

Expand All @@ -115,8 +119,8 @@ func (p *PriceFetcher) FetchPrices(ctx context.Context) error {
})
}

// send the updates to the app's price-feed service -> these will then be piped to the x/prices indexPriceCache via the price
// feed service
// send the updates to the app's price-feed service -> these will then be piped to the
// x/prices indexPriceCache via the pricefeed service
if p.priceFeedServiceClient == nil {
p.logger.Error("nil price feed service client")
}
Expand Down

0 comments on commit 3a8ebec

Please sign in to comment.