From 86bb33ed4715b64505ba9dba0e5ce747b78466fb Mon Sep 17 00:00:00 2001 From: jankun4 Date: Mon, 15 Apr 2024 13:32:29 +0200 Subject: [PATCH] [#720] fix drep/info null values Signed-off-by: jankun4 --- CHANGELOG.md | 1 + govtool/backend/sql/get-drep-info.sql | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d61d08d6..1382ce91e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ changes. ### Fixed +- drep/info no longer returns null values [Issue 720](https://github.com/IntersectMBO/govtool/issues/720) - drep/getVotes no longer returns 500 [Issue 685](https://github.com/IntersectMBO/govtool/issues/685) - drep/info no longer returns 500 [Issue 676](https://github.com/IntersectMBO/govtool/issues/676) - proposal/list search is case insensitive now [Issue 582](https://github.com/IntersectMBO/govtool/issues/582) diff --git a/govtool/backend/sql/get-drep-info.sql b/govtool/backend/sql/get-drep-info.sql index c72b65f39..2e8ee08f2 100644 --- a/govtool/backend/sql/get-drep-info.sql +++ b/govtool/backend/sql/get-drep-info.sql @@ -125,13 +125,13 @@ DRepRegister AS ( DRepRetire AS ( SELECT encode(AllRegistrationEntries.tx_hash, 'hex') as tx_hash, - AllRegistrationEntries.tx_id + AllRegistrationEntries.tx_id as tx_id FROM DRepRegister LEFT JOIN - AllRegistrationEntries ON AllRegistrationEntries.deposit < 0 - OR AllRegistrationEntries.voting_anchor_id IS NULL - WHERE AllRegistrationEntries.tx_id > DRepRegister.tx_id + AllRegistrationEntries ON (AllRegistrationEntries.deposit < 0 + OR AllRegistrationEntries.voting_anchor_id IS NULL) + and AllRegistrationEntries.tx_id > DRepRegister.tx_id ORDER BY AllRegistrationEntries.tx_id asc @@ -156,9 +156,9 @@ SoleVoterRetire AS ( FROM SoleVoterRegister LEFT JOIN - AllRegistrationEntries ON AllRegistrationEntries.deposit < 0 - OR AllRegistrationEntries.voting_anchor_id IS NOT NULL - WHERE AllRegistrationEntries.tx_id > SoleVoterRegister.tx_id + AllRegistrationEntries ON (AllRegistrationEntries.deposit < 0 + OR AllRegistrationEntries.voting_anchor_id IS NOT NULL) + AND AllRegistrationEntries.tx_id > SoleVoterRegister.tx_id ORDER BY AllRegistrationEntries.tx_id asc