Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dashboard): return network id in all cases #862

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/pkg/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ func TestPublicAndSharedDashboards(t *testing.T) {
numValidators := resp.Data.Validators.Exited + resp.Data.Validators.Offline + resp.Data.Validators.Pending + resp.Data.Validators.Online + resp.Data.Validators.Slashed
assert.Greater(t, numValidators, uint64(0), "dashboard should contain at least one validator")
assert.Greater(t, len(resp.Data.Groups), 0, "dashboard should contain at least one group")
assert.Greater(t, resp.Data.Network, uint64(0), "dashboard should contain a network id greater than 0")
})

t.Run(fmt.Sprintf("[%s]: test group summary", dashboardId.id), func(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion backend/pkg/api/data_access/vdb_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@ func (d *DataAccessService) GetValidatorDashboardOverview(ctx context.Context, d
id = $1`
return d.alloyReader.GetContext(ctx, &data.Network, query, dashboardId.Id)
})
} else { // load the chain id from the config in case of public dashboards
data.Network = utils.Config.Chain.ClConfig.DepositChainID
}
// TODO handle network of validator set dashboards

// Groups
if dashboardId.Validators == nil && !dashboardId.AggregateGroups {
Expand Down
Loading