Skip to content

Commit 2da504b

Browse files
committed
Fix gov flag
Fixes #1606
1 parent 419feee commit 2da504b

File tree

1 file changed

+14
-6
lines changed
  • cardano-db-sync/src/Cardano/DbSync/Era/Shelley

1 file changed

+14
-6
lines changed

cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Insert.hs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ insertCertificate syncEnv isMember blkId txId epochNo slotNo redeemers (Generic.
543543
liftIO $
544544
logWarning tracer "insertCertificate: Unhandled DCertGenesis certificate"
545545
Right (ConwayTxCertDeleg deleg) ->
546-
when (ioShelley iopts) $ insertConwayDelegCert syncEnv txId idx mRedeemerId epochNo slotNo deleg
546+
insertConwayDelegCert syncEnv txId idx mRedeemerId epochNo slotNo deleg
547547
Right (ConwayTxCertPool pool) ->
548548
when (ioShelley iopts) $ insertPoolCert tracer cache isMember network epochNo blkId txId idx pool
549549
Right (ConwayTxCertGov c) ->
@@ -687,20 +687,28 @@ insertConwayDelegCert ::
687687
ExceptT SyncNodeError (ReaderT SqlBackend m) ()
688688
insertConwayDelegCert syncEnv txId idx mRedeemerId epochNo slotNo dCert =
689689
case dCert of
690-
ConwayRegCert cred _dep -> insertStakeRegistration epochNo txId idx $ Generic.annotateStakingCred network cred
691-
ConwayUnRegCert cred _dep -> insertStakeDeregistration cache network epochNo txId idx mRedeemerId cred
690+
ConwayRegCert cred _dep ->
691+
when (ioShelley iopts) $
692+
insertStakeRegistration epochNo txId idx $ Generic.annotateStakingCred network cred
693+
ConwayUnRegCert cred _dep ->
694+
when (ioShelley iopts) $
695+
insertStakeDeregistration cache network epochNo txId idx mRedeemerId cred
692696
ConwayDelegCert cred delegatee -> insertDeleg cred delegatee
693697
ConwayRegDelegCert cred delegatee _dep -> do
694-
insertStakeRegistration epochNo txId idx $ Generic.annotateStakingCred network cred
698+
when (ioShelley iopts) $
699+
insertStakeRegistration epochNo txId idx $ Generic.annotateStakingCred network cred
695700
insertDeleg cred delegatee
696701
where
697702
insertDeleg cred = \case
698-
DelegStake poolkh -> insertDelegation trce cache network epochNo slotNo txId idx mRedeemerId cred poolkh
703+
DelegStake poolkh ->
704+
when (ioShelley iopts) $
705+
insertDelegation trce cache network epochNo slotNo txId idx mRedeemerId cred poolkh
699706
DelegVote drep ->
700707
when (ioGov iopts) $
701708
insertDelegationVote cache network txId idx cred drep
702709
DelegStakeVote poolkh drep -> do
703-
insertDelegation trce cache network epochNo slotNo txId idx mRedeemerId cred poolkh
710+
when (ioShelley iopts) $
711+
insertDelegation trce cache network epochNo slotNo txId idx mRedeemerId cred poolkh
704712
when (ioGov iopts) $
705713
insertDelegationVote cache network txId idx cred drep
706714

0 commit comments

Comments
 (0)