diff --git a/CHANGELOG.md b/CHANGELOG.md index 2524c51f9..5f42ac266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ changes. ### Fixed +- 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) - proposal/list now takes optional `search` query param [Issue 566](https://github.com/IntersectMBO/govtool/issues/566) - Fix possible sql error when there would be no predefined drep voting pwoer [Issue 501](https://github.com/IntersectMBO/govtool/issues/501) diff --git a/govtool/backend/sql/get-drep-info.sql b/govtool/backend/sql/get-drep-info.sql index a7b4536a5..899969be7 100644 --- a/govtool/backend/sql/get-drep-info.sql +++ b/govtool/backend/sql/get-drep-info.sql @@ -5,7 +5,7 @@ WITH DRepId AS ( LatestRegistrationEntry AS ( SELECT drep_registration.voting_anchor_id AS voting_anchor_id, - deposit AS deposit + drep_registration.deposit AS deposit, tx.hash as tx_hash FROM drep_registration @@ -98,7 +98,7 @@ SELECT CurrentMetadata.url, CurrentMetadata.data_hash, CurrentVotingPower.amount, - LatestRegistrationEntry.tx_hash + encode(LatestRegistrationEntry.tx_hash, 'hex') as tx_hash FROM IsRegisteredAsDRep CROSS JOIN IsRegisteredAsSoleVoter @@ -107,3 +107,4 @@ FROM CROSS JOIN CurrentDeposit CROSS JOIN CurrentMetadata CROSS JOIN CurrentVotingPower + CROSS JOIN LatestRegistrationEntry