Skip to content

Commit

Permalink
Merge pull request #2267 from IntersectMBO/test
Browse files Browse the repository at this point in the history
chore: update GovTool-v1.0.23 release date
  • Loading branch information
MSzalowski authored Oct 29, 2024
2 parents 4deaaf2 + 0153562 commit 5f5fb5a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ changes.

-

## [v1.0.23](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.23) 2024-10-28
## [v1.0.23](https://github.com/IntersectMBO/govtool/releases/tag/v1.0.23) 2024-10-29

### Added

Expand Down
28 changes: 17 additions & 11 deletions govtool/backend/src/VVA/DRep.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,23 @@ getVotes ::
m ([Vote], [Proposal])
getVotes drepId selectedProposals = withPool $ \conn -> do
results <- liftIO $ SQL.query conn getVotesSql (SQL.Only drepId)
let proposalsToSelect = if null selectedProposals
then [ govActionId | (_, govActionId, _, _, _, _, _, _, _) <- results]
else selectedProposals
proposals <- Proposal.getProposals (Just proposalsToSelect)
let proposalMap = M.fromList $ map (\x -> (proposalId x, x)) proposals
timeZone <- liftIO getCurrentTimeZone
return
([ Vote proposalId' drepId' vote' url' docHash' epochNo' (localTimeToUTC timeZone date') voteTxHash'
| (proposalId', govActionId', drepId', vote', url', docHash', epochNo', date', voteTxHash') <- results
, govActionId' `elem` proposalsToSelect
], proposals)

if null results
then return ([], [])
else do
let proposalsToSelect = if null selectedProposals
then [ govActionId | (_, govActionId, _, _, _, _, _, _, _) <- results]
else selectedProposals
proposals <- if null proposalsToSelect
then return []
else Proposal.getProposals (Just proposalsToSelect)
let proposalMap = M.fromList $ map (\x -> (proposalId x, x)) proposals
timeZone <- liftIO getCurrentTimeZone
let votes = [ Vote proposalId' drepId' vote' url' docHash' epochNo' (localTimeToUTC timeZone date') voteTxHash'
| (proposalId', govActionId', drepId', vote', url', docHash', epochNo', date', voteTxHash') <- results
, govActionId' `elem` proposalsToSelect
]
return (votes, proposals)

getDRepInfoSql :: SQL.Query
getDRepInfoSql = sqlFrom $(embedFile "sql/get-drep-info.sql")
Expand Down

0 comments on commit 5f5fb5a

Please sign in to comment.