@@ -99,10 +99,10 @@ queryDRepDistrAmount ::
9999queryDRepDistrAmount drepHash epochNo = do
100100 res <- selectOne $ do
101101 (distr :& hash) <-
102- from
103- $ table @ Db. DrepDistr
102+ from $
103+ table @ Db. DrepDistr
104104 `innerJoin` table @ Db. DrepHash
105- `on` (\ (distr :& hash) -> (hash ^. Db. DrepHashId ) ==. (distr ^. Db. DrepDistrHashId ))
105+ `on` (\ (distr :& hash) -> (hash ^. Db. DrepHashId ) ==. (distr ^. Db. DrepDistrHashId ))
106106
107107 where_ $ hash ^. Db. DrepHashRaw ==. just (val drepHash)
108108 where_ $ distr ^. Db. DrepDistrEpochNo ==. val epochNo
@@ -141,16 +141,16 @@ queryConstitutionAnchor ::
141141queryConstitutionAnchor epochNo = do
142142 res <- selectOne $ do
143143 (_ :& anchor :& epochState) <-
144- from
145- $ table @ Db. Constitution
144+ from $
145+ table @ Db. Constitution
146146 `innerJoin` table @ Db. VotingAnchor
147- `on` ( \ (constit :& anchor) ->
148- (constit ^. Db. ConstitutionVotingAnchorId ) ==. (anchor ^. Db. VotingAnchorId )
149- )
147+ `on` ( \ (constit :& anchor) ->
148+ (constit ^. Db. ConstitutionVotingAnchorId ) ==. (anchor ^. Db. VotingAnchorId )
149+ )
150150 `innerJoin` table @ Db. EpochState
151- `on` ( \ (constit :& _ :& epoch) ->
152- just (constit ^. Db. ConstitutionId ) ==. (epoch ^. Db. EpochStateConstitutionId )
153- )
151+ `on` ( \ (constit :& _ :& epoch) ->
152+ just (constit ^. Db. ConstitutionId ) ==. (epoch ^. Db. EpochStateConstitutionId )
153+ )
154154
155155 where_ (epochState ^. Db. EpochStateEpochNo ==. val epochNo)
156156
@@ -176,7 +176,7 @@ queryTreasuryDonations = do
176176 txs <- from $ table @ Db. Tx
177177 pure $ sum_ (txs ^. Db. TxTreasuryDonation )
178178
179- let total = join ( unValue <$> res)
179+ let total = unValue =<< res
180180 pure $ maybe 0 Db. unDbLovelace total
181181
182182queryVoteCounts ::
@@ -194,10 +194,10 @@ queryVoteCounts txHash idx = do
194194 countVotes v = do
195195 res <- selectOne $ do
196196 (vote :& tx) <-
197- from
198- $ table @ Db. VotingProcedure
197+ from $
198+ table @ Db. VotingProcedure
199199 `innerJoin` table @ Db. Tx
200- `on` (\ (vote :& tx) -> vote ^. Db. VotingProcedureTxId ==. tx ^. Db. TxId )
200+ `on` (\ (vote :& tx) -> vote ^. Db. VotingProcedureTxId ==. tx ^. Db. TxId )
201201 where_ $
202202 vote
203203 ^. Db. VotingProcedureVote
@@ -226,16 +226,16 @@ queryCommitteeByTxHash ::
226226queryCommitteeByTxHash txHash = do
227227 res <- selectOne $ do
228228 (committee :& _ :& tx) <-
229- from
230- $ table @ Db. Committee
229+ from $
230+ table @ Db. Committee
231231 `innerJoin` table @ Db. GovActionProposal
232- `on` ( \ (committee :& govAction) ->
233- committee ^. Db. CommitteeGovActionProposalId ==. just (govAction ^. Db. GovActionProposalId )
234- )
232+ `on` ( \ (committee :& govAction) ->
233+ committee ^. Db. CommitteeGovActionProposalId ==. just (govAction ^. Db. GovActionProposalId )
234+ )
235235 `innerJoin` table @ Db. Tx
236- `on` ( \ (_ :& govAction :& tx) ->
237- govAction ^. Db. GovActionProposalTxId ==. tx ^. Db. TxId
238- )
236+ `on` ( \ (_ :& govAction :& tx) ->
237+ govAction ^. Db. GovActionProposalTxId ==. tx ^. Db. TxId
238+ )
239239 where_ (tx ^. Db. TxHash ==. val txHash)
240240 pure committee
241241
@@ -248,20 +248,20 @@ queryCommitteeMemberCountByTxHash ::
248248queryCommitteeMemberCountByTxHash txHash = do
249249 res <- selectOne $ do
250250 (_ :& committee :& _ :& tx) <-
251- from
252- $ table @ Db. CommitteeMember
251+ from $
252+ table @ Db. CommitteeMember
253253 `innerJoin` table @ Db. Committee
254- `on` ( \ (member :& committee) ->
255- member ^. Db. CommitteeMemberCommitteeId ==. committee ^. Db. CommitteeId
256- )
254+ `on` ( \ (member :& committee) ->
255+ member ^. Db. CommitteeMemberCommitteeId ==. committee ^. Db. CommitteeId
256+ )
257257 `leftJoin` table @ Db. GovActionProposal
258- `on` ( \ (_ :& committee :& govAction) ->
259- committee ^. Db. CommitteeGovActionProposalId ==. govAction ?. Db. GovActionProposalId
260- )
258+ `on` ( \ (_ :& committee :& govAction) ->
259+ committee ^. Db. CommitteeGovActionProposalId ==. govAction ?. Db. GovActionProposalId
260+ )
261261 `leftJoin` table @ Db. Tx
262- `on` ( \ (_ :& _ :& govAction :& tx) ->
263- govAction ?. Db. GovActionProposalTxId ==. tx ?. Db. TxId
264- )
262+ `on` ( \ (_ :& _ :& govAction :& tx) ->
263+ govAction ?. Db. GovActionProposalTxId ==. tx ?. Db. TxId
264+ )
265265
266266 where_ $
267267 case txHash of
0 commit comments