Skip to content

Commit

Permalink
fix: Avoid panic on failure to fetch da account data (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItayLevyOfficial authored Jul 10, 2023
1 parent 65ba75c commit b014553
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions data_layer/celestia/celestia.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ func (c *Celestia) getDAAccData(config.RollappConfig) (*utils.AccountData, error

func (c *Celestia) GetDAAccData(cfg config.RollappConfig) ([]utils.AccountData, error) {
celAddress, err := c.getDAAccData(cfg)
if err != nil {
return nil, err
}
if celAddress == nil {
return nil, fmt.Errorf("failed to get DA account data")
}
return []utils.AccountData{*celAddress}, err
}

Expand Down
4 changes: 2 additions & 2 deletions utils/service_manager/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func (s *ServiceConfig) FetchServicesData(cfg config.RollappConfig) {
if service.FetchFn != nil {
accountData, err := service.FetchFn(cfg)
if err != nil {
//TODO: set the status to FAILED
return
s.Logger.Println(err)
continue
}
service.UIData.Accounts = accountData
if service.StatusFn != nil {
Expand Down

0 comments on commit b014553

Please sign in to comment.