Skip to content

Commit

Permalink
fix(api): early out if RP isn't deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
remoterami committed Jan 10, 2025
1 parent 5282c41 commit f83a240
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backend/pkg/api/data_access/vdb_rocket_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ import (
"golang.org/x/sync/errgroup"
)

func rocketPoolDeployed(ctx context.Context, d *DataAccessService) (bool, error) {
var rpDeployed bool
err := d.alloyReader.GetContext(ctx, &rpDeployed, "select count(*) > 0 from rocketpool_onchain_configs")
return rpDeployed, err
}

func (d *DataAccessService) GetValidatorDashboardRocketPool(ctx context.Context, dashboardId t.VDBId, cursor string, colSort t.Sort[enums.VDBRocketPoolColumn], search string, limit uint64) ([]t.VDBRocketPoolTableRow, *t.Paging, error) {
if deployed, err := rocketPoolDeployed(ctx, d); err != nil || !deployed {
return []t.VDBRocketPoolTableRow{}, &t.Paging{}, err
}

// Initialize the cursor
var currentCursor t.RocketPoolCursor
var err error
Expand Down

0 comments on commit f83a240

Please sign in to comment.