Skip to content

Commit

Permalink
Merge pull request #862 from gobitfly/BEDS-476/network_id_for_public_…
Browse files Browse the repository at this point in the history
…dashboards

fix(dashboard): return network id in all cases
  • Loading branch information
manuelsc authored Sep 18, 2024
2 parents 68708b8 + 9bc77b2 commit 5460d20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/pkg/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,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

0 comments on commit 5460d20

Please sign in to comment.