Skip to content

Commit

Permalink
(BIDS-2440) (NOBIDS) fix count queries
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrush committed Sep 5, 2023
1 parent 93c852c commit a972bcd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,7 @@ func GetWithdrawalsCountForQuery(query string) (uint64, error) {
FROM blocks_withdrawals w
INNER JOIN blocks b ON w.block_root = b.blockroot AND b.status = '1'
%s
ORDER BY b.block_slot DESC
ORDER BY w.block_slot DESC
LIMIT %d
) a`

Expand Down Expand Up @@ -2955,9 +2955,11 @@ func GetBLSChangesCountForQuery(query string) (uint64, error) {

blsQuery := `
SELECT COUNT(*) FROM (
SELECT b.slot
FROM blocks_bls_change bls
INNER JOIN blocks b ON bls.block_root = b.blockroot AND b.status = '1'
%s
ORDER BY b.slot DESC
LIMIT %d
) a
`
Expand Down

0 comments on commit a972bcd

Please sign in to comment.