Skip to content

Commit

Permalink
fix(api): copy&paste errors
Browse files Browse the repository at this point in the history
  • Loading branch information
invis-bitfly committed Jan 9, 2025
1 parent 5744969 commit 8ece7af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 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 @@ -100,7 +100,7 @@ func (d *DataAccessService) GetValidatorDashboardRewards(ctx context.Context, da
elDs := goqu.Dialect("postgres").
Select(
goqu.L("b.epoch"),
goqu.SUM(goqu.I("value")).As("el_rewards")).
goqu.COALESCE(goqu.SUM(goqu.I("value")), 0).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"))).
Expand Down Expand Up @@ -547,7 +547,7 @@ func (d *DataAccessService) GetValidatorDashboardGroupRewards(ctx context.Contex

elDs := goqu.Dialect("postgres").
Select(
goqu.SUM(goqu.I("value")).As("blocks_el_rewards")).
goqu.COALESCE(goqu.SUM(goqu.I("value")), 0).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"))).
Where(goqu.L("b.epoch = ?", epoch))
Expand Down Expand Up @@ -712,7 +712,7 @@ func (d *DataAccessService) GetValidatorDashboardRewardsChart(ctx context.Contex
elDs := goqu.Dialect("postgres").
Select(
goqu.L("b.epoch"),
goqu.SUM(goqu.I("value")).As("el_rewards")).
goqu.COALESCE(goqu.SUM(goqu.I("value")), 0).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"))).
Expand Down Expand Up @@ -955,7 +955,7 @@ func (d *DataAccessService) GetValidatorDashboardDuties(ctx context.Context, das
elDs := goqu.Dialect("postgres").
Select(
goqu.L("b.proposer"),
goqu.SUM(goqu.I("value")).As("el_rewards")).
goqu.COALESCE(goqu.SUM(goqu.I("value")), 0).As("el_rewards")).
From(goqu.I("execution_rewards_finalized").As("b")).
Where(goqu.L("b.epoch = ?", epoch)).
GroupBy(goqu.L("b.proposer"))
Expand Down
8 changes: 4 additions & 4 deletions backend/pkg/api/data_access/vdb_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ func (d *DataAccessService) GetValidatorDashboardSummary(ctx context.Context, da
elRewards := make(map[int64]decimal.Decimal)
ds = goqu.Dialect("postgres").
Select(
goqu.SUM(goqu.I("value")).As("el_rewards")).
goqu.COALESCE(goqu.SUM(goqu.I("value")), 0).As("el_rewards")).
From(goqu.I("execution_rewards_finalized").As("b")).
Where(goqu.L("b.epoch >= ? AND b.epoch <= ? AND b.status = '1'", epochMin, epochMax)).
Where(goqu.L("b.epoch >= ? AND b.epoch <= ?", epochMin, epochMax)).
GroupBy(goqu.L("result_group_id"))

if len(validators) > 0 {
Expand Down Expand Up @@ -918,8 +918,8 @@ func (d *DataAccessService) internal_getElClAPR(ctx context.Context, dashboardId
}

elDs := goqu.Dialect("postgres").
Select(goqu.SUM(goqu.I("value"))).
From(goqu.I("execution_rewards_finalized")).As("b")
Select(goqu.COALESCE(goqu.SUM(goqu.L("value / 1e18")), 0)).
From(goqu.I("execution_rewards_finalized").As("b"))

if len(dashboardId.Validators) > 0 {
elDs = elDs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (d *executionRewardsFinalizer) maintainTable() (err error) {
goqu.I("b.epoch").As("epoch"),
goqu.I("b.slot").As("slot"),
goqu.I("b.proposer").As("proposer"),
goqu.Func("sum", goqu.COALESCE(goqu.I("rb.value"), goqu.L("ep.fee_recipient_reward * '10e18'::numeric"), goqu.L("0::numeric"))).As("value"),
goqu.Func("sum", goqu.COALESCE(goqu.I("rb.value"), goqu.L("ep.fee_recipient_reward * '1e18'::numeric"), goqu.L("0::numeric"))).As("value"),
).
Where(
goqu.I("b.slot").Gt(lastExportedSlot),
Expand Down

0 comments on commit 8ece7af

Please sign in to comment.