Skip to content

Commit

Permalink
fix(api): 'b' is a rune, not a string
Browse files Browse the repository at this point in the history
  • Loading branch information
invis-bitfly committed Jan 9, 2025
1 parent ab9b048 commit d97b172
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions backend/pkg/api/data_access/vdb_rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (d *DataAccessService) GetValidatorDashboardRewards(ctx context.Context, da
goqu.SUM(goqu.I("value")).As("el_rewards")).
From(goqu.L("users_val_dashboards_validators v")).
Where(goqu.L("b.epoch >= ?", startEpoch)).
LeftJoin(goqu.I("execution_rewards_finalized").As('b'), goqu.On(goqu.L("v.validator_index = b.proposer"))).
LeftJoin(goqu.I("execution_rewards_finalized").As("b"), goqu.On(goqu.L("v.validator_index = b.proposer"))).
GroupBy(goqu.L("b.epoch"))

if dashboardId.Validators == nil {
Expand Down Expand Up @@ -549,7 +549,7 @@ func (d *DataAccessService) GetValidatorDashboardGroupRewards(ctx context.Contex
Select(
goqu.SUM(goqu.I("value")).As("blocks_el_rewards")).
From(goqu.L("users_val_dashboards_validators v")).
LeftJoin(goqu.I("execution_rewards_finalized").As('b'), goqu.On(goqu.L("v.validator_index = b.proposer"))).
LeftJoin(goqu.I("execution_rewards_finalized").As("b"), goqu.On(goqu.L("v.validator_index = b.proposer"))).
Where(goqu.L("b.epoch = ?", epoch))

// handle the case when we have a list of validators
Expand Down Expand Up @@ -715,7 +715,7 @@ func (d *DataAccessService) GetValidatorDashboardRewardsChart(ctx context.Contex
goqu.SUM(goqu.I("value")).As("el_rewards")).
From(goqu.L("users_val_dashboards_validators v")).
Where(goqu.L("b.epoch >= ?", startEpoch)).
LeftJoin(goqu.I("execution_rewards_finalized").As('b'), goqu.On(goqu.L("v.validator_index = b.proposer"))).
LeftJoin(goqu.I("execution_rewards_finalized").As("b"), goqu.On(goqu.L("v.validator_index = b.proposer"))).
GroupBy(goqu.L("b.epoch"))

if dashboardId.Validators == nil {
Expand Down Expand Up @@ -956,7 +956,7 @@ func (d *DataAccessService) GetValidatorDashboardDuties(ctx context.Context, das
Select(
goqu.L("b.proposer"),
goqu.SUM(goqu.I("value")).As("el_rewards")).
From(goqu.I("execution_rewards_finalized").As('b')).
From(goqu.I("execution_rewards_finalized").As("b")).
Where(goqu.L("b.epoch = ?", epoch)).
GroupBy(goqu.L("b.proposer"))

Expand Down
2 changes: 1 addition & 1 deletion backend/pkg/api/data_access/vdb_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (d *DataAccessService) GetValidatorDashboardSummary(ctx context.Context, da
ds = goqu.Dialect("postgres").
Select(
goqu.SUM(goqu.I("value")).As("el_rewards")).
From(goqu.I("execution_rewards_finalized").As('b')).
From(goqu.I("execution_rewards_finalized").As("b")).
Where(goqu.L("b.epoch >= ? AND b.epoch <= ? AND b.status = '1'", epochMin, epochMax)).
GroupBy(goqu.L("result_group_id"))

Expand Down

0 comments on commit d97b172

Please sign in to comment.