@@ -28,7 +28,7 @@ module Cardano.DbSync.Era.Universal.Insert.GovAction (
28
28
)
29
29
where
30
30
31
- import Cardano.BM.Trace (Trace , logWarning )
31
+ import Cardano.BM.Trace (Trace , logInfo , logWarning )
32
32
import qualified Cardano.Crypto as Crypto
33
33
import Cardano.Db (DbWord64 (.. ))
34
34
import qualified Cardano.Db as DB
@@ -140,33 +140,33 @@ insertGovActionProposal cache blkId txId govExpiresAt mmCommittee (index, pp) =
140
140
insertNewCommittee gapId removed added q = do
141
141
void $ insertCommittee' gapId (updatedCommittee removed added q <$> mmCommittee) q
142
142
143
- insertCommittee :: (MonadIO m , MonadBaseControl IO m ) => Maybe DB. GovActionProposalId -> Committee StandardConway -> ReaderT SqlBackend m DB. NewCommitteeInfoId
143
+ insertCommittee :: (MonadIO m , MonadBaseControl IO m ) => Maybe DB. GovActionProposalId -> Committee StandardConway -> ReaderT SqlBackend m DB. CommitteeId
144
144
insertCommittee mgapId committee = do
145
145
insertCommittee' mgapId (Just committee) (committeeThreshold committee)
146
146
147
- insertCommittee' :: (MonadIO m , MonadBaseControl IO m ) => Maybe DB. GovActionProposalId -> Maybe (Committee StandardConway ) -> UnitInterval -> ReaderT SqlBackend m DB. NewCommitteeInfoId
147
+ insertCommittee' :: (MonadIO m , MonadBaseControl IO m ) => Maybe DB. GovActionProposalId -> Maybe (Committee StandardConway ) -> UnitInterval -> ReaderT SqlBackend m DB. CommitteeId
148
148
insertCommittee' mgapId mcommittee q = do
149
- infoId <- insertNewCommitteeInfo
149
+ committeeId <- insertCommitteeDB
150
150
whenJust mcommittee $ \ committee ->
151
- mapM_ (insertNewMember infoId ) (Map. toList $ committeeMembers committee)
152
- pure infoId
151
+ mapM_ (insertNewMember committeeId ) (Map. toList $ committeeMembers committee)
152
+ pure committeeId
153
153
where
154
154
r = unboundRational q -- TODO work directly with Ratio Word64. This is not currently supported in ledger
155
- insertNewMember infoId (cred, e) = do
155
+ insertNewMember committeeId (cred, e) = do
156
156
chId <- insertCommitteeHash cred
157
- void . DB. insertNewCommitteeMember $
158
- DB. NewCommitteeMember
159
- { DB. newCommitteeMemberNewCommitteeInfoId = infoId
160
- , DB. newCommitteeMemberCommitteeHashId = chId
161
- , DB. newCommitteeMemberExpirationEpoch = unEpochNo e
157
+ void . DB. insertCommitteeMember $
158
+ DB. CommitteeMember
159
+ { DB. committeeMemberCommitteeId = committeeId
160
+ , DB. committeeMemberCommitteeHashId = chId
161
+ , DB. committeeMemberExpirationEpoch = unEpochNo e
162
162
}
163
163
164
- insertNewCommitteeInfo =
165
- DB. insertNewCommitteeInfo $
166
- DB. NewCommitteeInfo
167
- { DB. newCommitteeInfoGovActionProposalId = mgapId
168
- , DB. newCommitteeInfoQuorumNumerator = fromIntegral $ numerator r
169
- , DB. newCommitteeInfoQuorumDenominator = fromIntegral $ denominator r
164
+ insertCommitteeDB =
165
+ DB. insertCommittee $
166
+ DB. Committee
167
+ { DB. committeeGovActionProposalId = mgapId
168
+ , DB. committeeQuorumNumerator = fromIntegral $ numerator r
169
+ , DB. committeeQuorumDenominator = fromIntegral $ denominator r
170
170
}
171
171
172
172
--------------------------------------------------------------------------------------
@@ -465,7 +465,7 @@ insertUpdateEnacted trce blkId epochNo enactedState = do
465
465
(Nothing , Nothing ) -> pure (Nothing , Nothing )
466
466
(Nothing , Just committee) -> do
467
467
-- No enacted proposal means we're after conway genesis territory
468
- committeeIds <- lift $ DB. queryProposalNewCommitteeInfo Nothing
468
+ committeeIds <- lift $ DB. queryProposalCommittee Nothing
469
469
case committeeIds of
470
470
[] -> do
471
471
committeeId <- lift $ insertCommittee Nothing committee
@@ -476,7 +476,7 @@ insertUpdateEnacted trce blkId epochNo enactedState = do
476
476
-- No committee with enacted action means it's a no confidence action.
477
477
pure (Nothing , Just committeeGaId)
478
478
(Just committeeGaId, Just committee) -> do
479
- committeeIds <- lift $ DB. queryProposalNewCommitteeInfo (Just committeeGaId)
479
+ committeeIds <- lift $ DB. queryProposalCommittee (Just committeeGaId)
480
480
case committeeIds of
481
481
[] -> do
482
482
-- This should never happen. Having a committee and an enacted action, means
0 commit comments