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

212 create sole voter information endpoint #315

Merged
merged 2 commits into from
Feb 27, 2024
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
6 changes: 2 additions & 4 deletions govtool/backend/sql/get-drep-info.sql
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
WITH DRepId AS (
SELECT decode(?, 'hex') as raw
), IsRegisteredAsDRep AS (
SELECT (deposit>0) as value,
SELECT (drep_registration.voting_anchor_id is not null and deposit>0) as value,
deposit as deposit
FROM drep_registration
JOIN drep_hash
ON drep_hash.id = drep_registration.drep_hash_id
CROSS JOIN DRepId
WHERE drep_hash.raw = DRepId.raw
and deposit is not null
and drep_registration.voting_anchor_id is not null
ORDER BY drep_registration.tx_id DESC
LIMIT 1
), WasRegisteredAsDRep AS (
Expand All @@ -24,15 +23,14 @@ WITH DRepId AS (
and drep_registration.voting_anchor_id is not null
)) as value
), IsRegisteredAsSoleVoter AS (
SELECT (deposit>0) as value,
SELECT (drep_registration.voting_anchor_id is null and deposit>0) as value,
deposit as deposit
FROM drep_registration
JOIN drep_hash
ON drep_hash.id = drep_registration.drep_hash_id
CROSS JOIN DRepId
WHERE drep_hash.raw = DRepId.raw
and deposit is not null
and drep_registration.voting_anchor_id is null
ORDER BY drep_registration.tx_id DESC
LIMIT 1
), WasRegisteredAsSoleVoter AS (
Expand Down
2 changes: 1 addition & 1 deletion govtool/backend/src/VVA/API/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ exampleDRepInfoResponse :: Text
exampleDRepInfoResponse =
"{\"isRegisteredAsDRep\": false,"
<> "\"wasRegisteredAsDRep\": true,"
<> "\"wasRegisteredAsSoleVoter\": true,"
<> "\"isRegisteredAsSoleVoter\": true,"
<> "\"wasRegisteredAsSoleVoter\": true,"
<> "\"deposit\": 2000000}"

Expand Down