Skip to content

Commit 5465b91

Browse files
committed
Refactor Shelley Insert.hs
1 parent 15656e4 commit 5465b91

File tree

10 files changed

+1696
-1417
lines changed

10 files changed

+1696
-1417
lines changed

cardano-db-sync/cardano-db-sync.cabal

+6
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,14 @@ library
8686
Cardano.DbSync.Era.Shelley.Generic.Witness
8787
Cardano.DbSync.Era.Shelley.Genesis
8888
Cardano.DbSync.Era.Shelley.Insert
89+
Cardano.DbSync.Era.Shelley.Insert.Certificate
8990
Cardano.DbSync.Era.Shelley.Insert.Epoch
91+
Cardano.DbSync.Era.Shelley.Insert.GovAction
9092
Cardano.DbSync.Era.Shelley.Insert.Grouped
93+
Cardano.DbSync.Era.Shelley.Insert.Other
94+
Cardano.DbSync.Era.Shelley.Insert.Pool
95+
Cardano.DbSync.Era.Shelley.Insert.Tx
96+
9197
Cardano.DbSync.Era.Shelley.Query
9298
Cardano.DbSync.Era.Shelley.Validate
9399

cardano-db-sync/src/Cardano/DbSync/Api/Ledger.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import Cardano.DbSync.Api.Types
1313
import Cardano.DbSync.Era.Shelley.Generic.Tx.Babbage (fromTxOut)
1414
import Cardano.DbSync.Era.Shelley.Generic.Tx.Types (DBPlutusScript)
1515
import qualified Cardano.DbSync.Era.Shelley.Generic.Util as Generic
16-
import qualified Cardano.DbSync.Era.Shelley.Insert as Insert
1716
import Cardano.DbSync.Era.Shelley.Insert.Grouped
17+
import Cardano.DbSync.Era.Shelley.Insert.Tx (insertTxOut)
1818
import Cardano.DbSync.Era.Util
1919
import Cardano.DbSync.Error
2020
import Cardano.DbSync.Ledger.State
@@ -171,7 +171,7 @@ prepareTxOut syncEnv txCache (TxIn txHash (TxIx index), txOut) = do
171171
let txHashByteString = Generic.safeHashToByteString $ unTxId txHash
172172
let genTxOut = fromTxOut index txOut
173173
txId <- queryTxIdWithCache txCache txHashByteString
174-
Insert.prepareTxOut trce cache iopts (txId, txHashByteString) genTxOut
174+
insertTxOut trce cache iopts (txId, txHashByteString) genTxOut
175175
where
176176
trce = getTrace syncEnv
177177
cache = envCache syncEnv

cardano-db-sync/src/Cardano/DbSync/Default.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import Cardano.DbSync.Era.Byron.Insert (insertByronBlock)
2222
import Cardano.DbSync.Era.Cardano.Insert (insertEpochSyncTime)
2323
import Cardano.DbSync.Era.Shelley.Adjust (adjustEpochRewards)
2424
import qualified Cardano.DbSync.Era.Shelley.Generic as Generic
25-
import Cardano.DbSync.Era.Shelley.Insert (insertShelleyBlock, mkAdaPots)
25+
import Cardano.DbSync.Era.Shelley.Insert (insertShelleyBlock)
26+
import Cardano.DbSync.Era.Shelley.Insert.Certificate (mkAdaPots)
2627
import Cardano.DbSync.Era.Shelley.Insert.Epoch (insertInstantRewards, insertPoolDepositRefunds, insertRewards)
2728
import Cardano.DbSync.Era.Shelley.Validate (validateEpochRewards)
2829
import Cardano.DbSync.Error

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ import Cardano.DbSync.Api
1717
import Cardano.DbSync.Api.Types (SyncEnv (envBackend))
1818
import Cardano.DbSync.Cache.Types (Cache (..), uninitiatedCache)
1919
import qualified Cardano.DbSync.Era.Shelley.Generic.Util as Generic
20-
import Cardano.DbSync.Era.Shelley.Insert
20+
import Cardano.DbSync.Era.Shelley.Insert.Certificate (insertDelegation, insertStakeRegistration)
21+
import Cardano.DbSync.Era.Shelley.Insert.Other (insertStakeAddressRefIfMissing)
22+
import Cardano.DbSync.Era.Shelley.Insert.Pool (insertPoolRegister)
2123
import Cardano.DbSync.Era.Util (liftLookupFail)
2224
import Cardano.DbSync.Error
2325
import Cardano.DbSync.Util

0 commit comments

Comments
 (0)