Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kderme committed Aug 17, 2023
1 parent 8675d12 commit 380a313
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Insert.hs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ insertTx syncEnv isMember blkId epochNo slotNo depositsMap blockIndex tx grouped
let !outSum = fromIntegral $ unCoin $ Generic.txOutSum tx
!withdrawalSum = fromIntegral $ unCoin $ Generic.txWithdrawalSum tx
hasConsumed <- liftIO $ getHasConsumed syncEnv
-- In some txs and with specific configuration we may be able to find necessary data within the tx body.
-- In these cases we can avoid expensive queries.
(resolvedInputs, fees', deposits) <- case (mdeposits, unCoin <$> Generic.txFees tx) of
(Just deposits, Just fees) -> do
(resolvedInputs, _) <- splitLast <$> mapM (resolveTxInputs hasConsumed False (fst <$> groupedTxOut grouped)) (Generic.txInputs tx)
Expand Down Expand Up @@ -503,7 +505,7 @@ insertCertificate tracer cache isMember network blkId txId epochNo slotNo redeem
Left (ShelleyTxCertMir mir) -> insertMirCert tracer cache network txId idx mir
Left (ShelleyTxCertGenesisDeleg _gen) ->
liftIO $ logWarning tracer "insertCertificate: Unhandled DCertGenesis certificate"
Right (ConwayTxCertDeleg deleg) -> insertConwayDelegCert tracer cache network txId idx mRedeemerId epochNo slotNo deleg
Right (ConwayTxCertDeleg deleg) -> insertConwayDelegCert cache network txId idx mRedeemerId epochNo slotNo deleg
Right (ConwayTxCertPool pool) -> insertPoolCert tracer cache isMember network epochNo blkId txId idx pool
Right (ConwayTxCertCommittee c) -> case c of
ConwayRegDRep cred coin ->
Expand Down Expand Up @@ -618,7 +620,6 @@ insertDelegCert _tracer cache network txId idx mRedeemerId epochNo slotNo dCert

insertConwayDelegCert ::
(MonadBaseControl IO m, MonadIO m) =>
Trace IO Text ->
Cache ->
Ledger.Network ->
DB.TxId ->
Expand All @@ -628,7 +629,7 @@ insertConwayDelegCert ::
SlotNo ->
ConwayDelegCert StandardCrypto ->
ExceptT SyncNodeError (ReaderT SqlBackend m) ()
insertConwayDelegCert _tracer cache network txId idx mRedeemerId epochNo slotNo dCert =
insertConwayDelegCert cache network txId idx mRedeemerId epochNo slotNo dCert =
case dCert of
ConwayRegCert cred _dep -> insertStakeRegistration epochNo txId idx $ Generic.annotateStakingCred network cred
ConwayUnRegCert cred _dep -> insertStakeDeregistration cache network epochNo txId idx mRedeemerId cred
Expand Down
2 changes: 1 addition & 1 deletion cardano-db-sync/src/Cardano/DbSync/Fix/PlutusDataBytes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ fixPlutusData tracer cblk fds = do

scrapDatumsBlock :: CardanoBlock -> Map ByteString ByteString
scrapDatumsBlock cblk = case cblk of
BlockConway _blk -> mempty -- This bug existed in a version that didn't support Conway
BlockConway _blk -> mempty -- This bug existed in a version that didn't support Conway or later eras
BlockBabbage blk -> Map.unions $ scrapDatumsTxBabbage . snd <$> getTxs blk
BlockAlonzo blk -> Map.unions $ scrapDatumsTxAlonzo . snd <$> getTxs blk
BlockByron _ -> error "No Datums in Byron"
Expand Down
2 changes: 1 addition & 1 deletion cardano-db-sync/src/Cardano/DbSync/Fix/PlutusScripts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ scrapScriptBlock cblk = case cblk of
BlockShelley _ -> error "No Plutus Scripts in Shelley"
BlockAllegra _ -> error "No Plutus Scripts in Allegra"
BlockMary _ -> error "No Plutus Scripts in Mary"
_ -> mempty -- This bug existed in a version that didn't support Conway
_ -> mempty -- This bug existed in a version that didn't support Conway or later eras

scrapScriptTxBabbage :: Ledger.Tx StandardBabbage -> Map ByteString ByteString
scrapScriptTxBabbage tx = Map.union txMap txOutMap
Expand Down

0 comments on commit 380a313

Please sign in to comment.