@@ -99,7 +99,7 @@ queryDRepDistrAmount drepHash epochNo = do
9999 from
100100 $ table @ Db. DrepDistr
101101 `innerJoin` table @ Db. DrepHash
102- `on` (\ (distr :& hash) -> (hash ^. Db. DrepHashId ) ==. (distr ^. Db. DrepDistrHashId ))
102+ `on` (\ (distr :& hash) -> (hash ^. Db. DrepHashId ) ==. (distr ^. Db. DrepDistrHashId ))
103103
104104 where_ $ hash ^. Db. DrepHashRaw ==. just (val drepHash)
105105 where_ $ distr ^. Db. DrepDistrEpochNo ==. val epochNo
@@ -141,13 +141,13 @@ queryConstitutionAnchor epochNo = do
141141 from
142142 $ table @ Db. Constitution
143143 `innerJoin` table @ Db. VotingAnchor
144- `on` ( \ (constit :& anchor) ->
145- (constit ^. Db. ConstitutionVotingAnchorId ) ==. (anchor ^. Db. VotingAnchorId )
146- )
144+ `on` ( \ (constit :& anchor) ->
145+ (constit ^. Db. ConstitutionVotingAnchorId ) ==. (anchor ^. Db. VotingAnchorId )
146+ )
147147 `innerJoin` table @ Db. EpochState
148- `on` ( \ (constit :& _ :& epoch) ->
149- just (constit ^. Db. ConstitutionId ) ==. (epoch ^. Db. EpochStateConstitutionId )
150- )
148+ `on` ( \ (constit :& _ :& epoch) ->
149+ just (constit ^. Db. ConstitutionId ) ==. (epoch ^. Db. EpochStateConstitutionId )
150+ )
151151
152152 where_ (epochState ^. Db. EpochStateEpochNo ==. val epochNo)
153153
@@ -194,10 +194,12 @@ queryVoteCounts txHash idx = do
194194 from
195195 $ table @ Db. VotingProcedure
196196 `innerJoin` table @ Db. Tx
197- `on` (\ (vote :& tx) -> vote ^. Db. VotingProcedureTxId ==. tx ^. Db. TxId )
198- where_ $
199- vote ^. Db. VotingProcedureVote ==. val v
200- &&. tx ^. Db. TxHash ==. val txHash
201- &&. vote ^. Db. VotingProcedureIndex ==. val idx
197+ `on` (\ (vote :& tx) -> vote ^. Db. VotingProcedureTxId ==. tx ^. Db. TxId )
198+ where_
199+ $ vote
200+ ^. Db. VotingProcedureVote
201+ ==. val v
202+ &&. tx ^. Db. TxHash ==. val txHash
203+ &&. vote ^. Db. VotingProcedureIndex ==. val idx
202204 pure countRows
203205 pure (maybe 0 unValue res)
0 commit comments