Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#2125): fix counting governance action expiration #2138

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ changes.

### Fixed

- Fix counting epoch boundaries for Governance Actions [Issue 2125](https://github.com/IntersectMBO/govtool/issues/2125)
- Fix displaying the SPO Votes [Issue 2085](https://github.com/IntersectMBO/govtool/issues/2085)

### Changed
Expand Down
15 changes: 13 additions & 2 deletions govtool/backend/sql/list-proposals.sql
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,16 @@ SELECT
null
end
) as description,
epoch_utils.last_epoch_end_time + epoch_utils.epoch_duration * (gov_action_proposal.expiration - epoch_utils.last_epoch_no),
CASE
WHEN meta.network_name::text = 'mainnet' THEN
epoch_utils.last_epoch_end_time +
epoch_utils.epoch_duration * (gov_action_proposal.expiration - epoch_utils.last_epoch_no)::bigint +
INTERVAL '5 days'
ELSE
epoch_utils.last_epoch_end_time +
epoch_utils.epoch_duration * (gov_action_proposal.expiration - epoch_utils.last_epoch_no)::bigint +
INTERVAL '1 day'
END AS expiry_date,
gov_action_proposal.expiration,
creator_block.time,
creator_block.epoch_no,
Expand Down Expand Up @@ -95,6 +104,7 @@ FROM
CROSS JOIN EpochUtils AS epoch_utils
CROSS JOIN always_no_confidence_voting_power
CROSS JOIN always_abstain_voting_power
CROSS JOIN meta
JOIN tx AS creator_tx ON creator_tx.id = gov_action_proposal.tx_id
JOIN block AS creator_block ON creator_block.id = creator_tx.block_id
LEFT JOIN voting_anchor ON voting_anchor.id = gov_action_proposal.voting_anchor_id
Expand Down Expand Up @@ -161,4 +171,5 @@ GROUP BY
always_no_confidence_voting_power.amount,
always_abstain_voting_power.amount,
prev_gov_action.index,
prev_gov_action_tx.hash)
prev_gov_action_tx.hash,
meta.network_name)
Loading