Skip to content

Commit

Permalink
Merge pull request #157 from gobitfly/NOBIDS/group-rewards-epoch-param
Browse files Browse the repository at this point in the history
fix group rewards endpoint
  • Loading branch information
remoterami authored Mar 28, 2024
2 parents 3209f97 + a1ab57c commit 7669165
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/pkg/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func addRoutes(hs *handlers.HandlerService, publicRouter, internalRouter *mux.Ro
{"GET", "/validator-dashboards/{dashboard_id}/groups/{group_id}/summary", hs.PublicGetValidatorDashboardGroupSummary, hs.InternalGetValidatorDashboardGroupSummary},
{"GET", "/validator-dashboards/{dashboard_id}/summary-chart", hs.PublicGetValidatorDashboardSummaryChart, hs.InternalGetValidatorDashboardSummaryChart},
{"GET", "/validator-dashboards/{dashboard_id}/rewards", hs.PublicGetValidatorDashboardRewards, hs.InternalGetValidatorDashboardRewards},
{"GET", "/validator-dashboards/{dashboard_id}/groups/{group_id}/rewards", hs.PublicGetValidatorDashboardGroupRewards, hs.InternalGetValidatorDashboardGroupRewards},
{"GET", "/validator-dashboards/{dashboard_id}/groups/{group_id}/rewards/{epoch}", hs.PublicGetValidatorDashboardGroupRewards, hs.InternalGetValidatorDashboardGroupRewards},
{"GET", "/validator-dashboards/{dashboard_id}/rewards-chart", hs.PublicGetValidatorDashboardRewardsChart, hs.InternalGetValidatorDashboardRewardsChart},
{"GET", "/validator-dashboards/{dashboard_id}/duties/{epoch}", hs.PublicGetValidatorDashboardDuties, hs.InternalGetValidatorDashboardDuties},
{"GET", "/validator-dashboards/{dashboard_id}/blocks", hs.PublicGetValidatorDashboardBlocks, hs.InternalGetValidatorDashboardBlocks},
Expand Down
7 changes: 6 additions & 1 deletion backend/pkg/api/types/validator_dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ type VDBGroupRewardsData struct {
AttestationsHead VDBGroupRewardsDetails `json:"attestations_head"`
Sync VDBGroupRewardsDetails `json:"sync"`
Slashing VDBGroupRewardsDetails `json:"slashing"`
Inactivity VDBGroupRewardsDetails `json:"inactivity"`
Proposal VDBGroupRewardsDetails `json:"proposal"`
ProposalElReward decimal.Decimal `json:"proposal_el_reward"`

ProposalElReward decimal.Decimal `json:"proposal_el_reward"`
ProposalClAttIncReward decimal.Decimal `json:"proposal_cl_att_inc_reward"`
ProposalClSyncIncReward decimal.Decimal `json:"proposal_cl_sync_inc_reward"`
ProposalClSlashingIncReward decimal.Decimal `json:"proposal_cl_slashing_inc_reward"`
}
type InternalGetValidatorDashboardGroupRewardsResponse ApiDataResponse[VDBGroupRewardsData]

Expand Down
4 changes: 4 additions & 0 deletions frontend/types/api/validator_dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,12 @@ export interface VDBGroupRewardsData {
attestations_head: VDBGroupRewardsDetails;
sync: VDBGroupRewardsDetails;
slashing: VDBGroupRewardsDetails;
inactivity: VDBGroupRewardsDetails;
proposal: VDBGroupRewardsDetails;
proposal_el_reward: string /* decimal.Decimal */;
proposal_cl_att_inc_reward: string /* decimal.Decimal */;
proposal_cl_sync_inc_reward: string /* decimal.Decimal */;
proposal_cl_slashing_inc_reward: string /* decimal.Decimal */;
}
export type InternalGetValidatorDashboardGroupRewardsResponse = ApiDataResponse<VDBGroupRewardsData>;
export type InternalGetValidatorDashboardRewardsChartResponse = ApiDataResponse<ChartData<number /* int */>>; // bar chart, series id is group id, stack is 'execution' or 'consensus'
Expand Down

0 comments on commit 7669165

Please sign in to comment.