Skip to content

Commit

Permalink
fix: drep_always_[abstain|no_confidence] coalesce sql failure
Browse files Browse the repository at this point in the history
  • Loading branch information
johnalotoski committed Mar 15, 2024
1 parent d18415d commit 9920dcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions govtool/backend/sql/get-network-metrics.sql
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ with current_epoch as (
select count(*) as count
from drep_hash
), always_abstain_voting_power as (
select coalesce(amount, 0) as amount
select coalesce((select amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.view = 'drep_always_abstain'
order by epoch_no desc
limit 1
limit 1), 0) as amount
), always_no_confidence_voting_power as (
select coalesce(amount, 0) as amount
select coalesce((select amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.view = 'drep_always_no_confidence'
order by epoch_no desc
limit 1
limit 1), 0) as amount
)

select
Expand Down
8 changes: 4 additions & 4 deletions govtool/backend/sql/list-proposals.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ WITH LatestDrepDistr AS (
Max(end_time) as last_epoch_end_time
FROM epoch
), always_no_confidence_voting_power as (
select coalesce(amount, 0) as amount
select coalesce((select amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.view = 'drep_always_no_confidence'
order by epoch_no desc
limit 1
limit 1), 0) as amount
), always_abstain_voting_power as (
select coalesce(amount, 0) as amount
select coalesce((select amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.view = 'drep_always_abstain'
order by epoch_no desc
limit 1
limit 1), 0) as amount
)

select
Expand Down

0 comments on commit 9920dcb

Please sign in to comment.