Skip to content

Commit

Permalink
Merge pull request #462 from gobitfly/NOBIDS/Fix_missing_smallint_cas…
Browse files Browse the repository at this point in the history
…t_for_summary

Fixed missing cast to int for postgres
  • Loading branch information
peterbitfly authored Jun 12, 2024
2 parents a13fbd3 + 63a69a3 commit 9db6cce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/pkg/api/data_access/vdb_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (d *DataAccessService) GetValidatorDashboardSummary(dashboardId t.VDBId, cu
var queryResult []queryResult

if len(validatorList) > 0 {
query := `select $1 AS group_id, attestations_reward, attestations_ideal_reward, blocks_proposed, blocks_scheduled, sync_executed, sync_scheduled FROM (
query := `select $1::smallint AS group_id, attestations_reward, attestations_ideal_reward, blocks_proposed, blocks_scheduled, sync_executed, sync_scheduled FROM (
select
SUM(attestations_reward)::decimal AS attestations_reward,
SUM(attestations_ideal_reward)::decimal AS attestations_ideal_reward,
Expand All @@ -98,7 +98,7 @@ func (d *DataAccessService) GetValidatorDashboardSummary(dashboardId t.VDBId, cu
from %[1]s
where validator_index = ANY($2)
) as a;`
err := d.alloyReader.Select(&queryResult, fmt.Sprintf(query, tableName), int(t.DefaultGroupId), validatorList)
err := d.alloyReader.Select(&queryResult, fmt.Sprintf(query, tableName), t.DefaultGroupId, validatorList)
if err != nil {
return nil, fmt.Errorf("error retrieving data from table %s: %v", tableName, err)
}
Expand Down

0 comments on commit 9db6cce

Please sign in to comment.