Commit e4e83b0b authored by Ethen Pociask's avatar Ethen Pociask

[indexer.client] Pass lint

parent 250d80c5
...@@ -30,7 +30,7 @@ type Api struct { ...@@ -30,7 +30,7 @@ type Api struct {
const ( const (
MetricsNamespace = "op_indexer" MetricsNamespace = "op_indexer"
addressParam = "{address:%s}" addressParam = "{address:%s}"
DepositsPath = "/api/v0/deposits/" DepositsPath = "/api/v0/deposits/"
WithdrawalsPath = "/api/v0/withdrawals/" WithdrawalsPath = "/api/v0/withdrawals/"
) )
...@@ -52,8 +52,8 @@ func NewApi(logger log.Logger, bv database.BridgeTransfersView, serverConfig con ...@@ -52,8 +52,8 @@ func NewApi(logger log.Logger, bv database.BridgeTransfersView, serverConfig con
apiRouter.Use(middleware.Recoverer) apiRouter.Use(middleware.Recoverer)
apiRouter.Use(middleware.Heartbeat("/healthz")) apiRouter.Use(middleware.Heartbeat("/healthz"))
apiRouter.Get(fmt.Sprintf(DepositsPath + addressParam, ethereumAddressRegex), h.L1DepositsHandler) apiRouter.Get(fmt.Sprintf(DepositsPath+addressParam, ethereumAddressRegex), h.L1DepositsHandler)
apiRouter.Get(fmt.Sprintf(WithdrawalsPath + addressParam, ethereumAddressRegex), h.L2WithdrawalsHandler) apiRouter.Get(fmt.Sprintf(WithdrawalsPath+addressParam, ethereumAddressRegex), h.L2WithdrawalsHandler)
return &Api{log: logger, Router: apiRouter, metricsRegistry: mr, serverConfig: serverConfig, metricsConfig: metricsConfig} return &Api{log: logger, Router: apiRouter, metricsRegistry: mr, serverConfig: serverConfig, metricsConfig: metricsConfig}
} }
......
...@@ -79,6 +79,10 @@ func (ic *IndexerClient) GetWithdrawalsByAddress(l2Address string, cursor string ...@@ -79,6 +79,10 @@ func (ic *IndexerClient) GetWithdrawalsByAddress(l2Address string, cursor string
return nil, fmt.Errorf("failed to read response body: %w", err) return nil, fmt.Errorf("failed to read response body: %w", err)
} }
defer func() {
_ = resp.Body.Close()
}()
if err := json.Unmarshal(body, &wResponse); err != nil { if err := json.Unmarshal(body, &wResponse); err != nil {
return nil, err return nil, err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment