Skip to content

Commit

Permalink
typo, on initialize try to get oracle params at most for 24hours inst…
Browse files Browse the repository at this point in the history
…ead of forever
  • Loading branch information
leonz789 committed Dec 27, 2024
1 parent 7ef38b3 commit a66c727
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
10 changes: 4 additions & 6 deletions cmd/feeder_tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,10 @@ func initComponents(logger types.LoggerInf, conf types.Config, standalone bool)
}

ec, _ := exoclient.GetClient()
_, err = ec.GetParams()
for err != nil {
// retry forever until be interrupted manually
logger.Info("failed to get oracle params on start, retrying...", "error", err)
time.Sleep(2 * time.Second)
_, err = ec.GetParams()

_, err = getOracleParamsWithMaxRetry(DefaultRetryConfig.MaxAttempts, ec, logger)
if err != nil {
return fmt.Errorf("failed to get oracle params on start, error:%w", err)
}

// init native stakerlist for nstETH(beaconchain)
Expand Down
5 changes: 1 addition & 4 deletions exoclient/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,13 @@ func (s *SubscribeResult) GetEventUpdateNST() (*EventUpdateNST, error) {
}
parsed := strings.Split(nstChange, "_")
if len(parsed) != 4 {
return nil, fmt.Errorf("failed to parse nstChange due to length is not expected 4 from event_txUPdatedNST response", "nstChange_str", nstChange)
return nil, fmt.Errorf("failed to parse nstChange: expected 4 parts but got %d, nstChange: %s", len(parsed), nstChange)
}
deposit := parsed[0] == "deposit"
stakerID, err := strconv.ParseInt(parsed[1], 10, 64)
if err != nil {
return nil, fmt.Errorf("failed to parse stakerID in nstChange from evetn_txUpdateNST response, error:%w", err)
}
if err != nil {
return nil, fmt.Errorf("failed to parse beaconchain_valdiatorIndex in nstChange from event_txUpdateNST response, error:%w", err)
}
index, err := strconv.ParseInt(parsed[3], 10, 64)
if err != nil {
return nil, fmt.Errorf("failed to parse beaconchain_sync_index in nstChange from event_txUpdateNST response, error:%w", err)
Expand Down
4 changes: 2 additions & 2 deletions fetcher/chainlink/chainlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
func (s *source) fetch(token string) (*fetchertypes.PriceInfo, error) {
chainlinkPriceFeedProxy, ok := s.chainlinkProxy.get(token)
if !ok {
return nil, feedertypes.ErrSourceTokenNotConfigured.Wrap(fmt.Sprintf("failed to get chainlinkProxy for token:%s for not set", token))
return nil, feedertypes.ErrSourceTokenNotConfigured.Wrap(fmt.Sprintf("chainlinkProxy not configured for token: %s", token))
}

roundData, err := chainlinkPriceFeedProxy.LatestRoundData(&bind.CallOpts{})
Expand Down Expand Up @@ -85,5 +85,5 @@ func (s *source) reload(cfgPath string, token string) error {
return nil
}
}
return errors.New("token not found in reloaded config filed")
return errors.New("token not found in reloaded config file")
}

0 comments on commit a66c727

Please sign in to comment.