Skip to content

Commit

Permalink
Fixed missing cast to int for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
Eisei24 committed Jun 12, 2024
1 parent a13fbd3 commit 63a69a3
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 63a69a3

Please sign in to comment.