Skip to content

Commit 06edd10

Browse files
committed
remove migration fix related code
1 parent 72db710 commit 06edd10

File tree

29 files changed

+146
-4156
lines changed

29 files changed

+146
-4156
lines changed

cardano-chain-gen/cardano-chain-gen.cabal

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,21 @@ test-suite cardano-chain-gen
130130
other-modules: Test.Cardano.Db.Mock.Config
131131
Test.Cardano.Db.Mock.Examples
132132
Test.Cardano.Db.Mock.Property.Property
133+
Test.Cardano.Db.Mock.UnifiedApi
134+
Test.Cardano.Db.Mock.Unit.Alonzo
135+
Test.Cardano.Db.Mock.Unit.Alonzo.Config
136+
Test.Cardano.Db.Mock.Unit.Alonzo.Simple
137+
Test.Cardano.Db.Mock.Unit.Alonzo.Tx
138+
Test.Cardano.Db.Mock.Unit.Babbage
139+
Test.Cardano.Db.Mock.Unit.Babbage.Reward
140+
Test.Cardano.Db.Mock.Unit.Babbage.Simple
141+
Test.Cardano.Db.Mock.Unit.Babbage.Tx
133142
Test.Cardano.Db.Mock.Unit.Conway
134143
Test.Cardano.Db.Mock.Unit.Conway.CommandLineArg.ConfigFile
135144
Test.Cardano.Db.Mock.Unit.Conway.CommandLineArg.EpochDisabled
136145
Test.Cardano.Db.Mock.Unit.Conway.Config.JsonbInSchema
137-
Test.Cardano.Db.Mock.Unit.Conway.Config.Parse
138146
Test.Cardano.Db.Mock.Unit.Conway.Config.MigrateConsumedPruneTxOut
147+
Test.Cardano.Db.Mock.Unit.Conway.Config.Parse
139148
Test.Cardano.Db.Mock.Unit.Conway.Governance
140149
Test.Cardano.Db.Mock.Unit.Conway.InlineAndReference
141150
Test.Cardano.Db.Mock.Unit.Conway.Other
@@ -145,7 +154,6 @@ test-suite cardano-chain-gen
145154
Test.Cardano.Db.Mock.Unit.Conway.Simple
146155
Test.Cardano.Db.Mock.Unit.Conway.Stake
147156
Test.Cardano.Db.Mock.Unit.Conway.Tx
148-
Test.Cardano.Db.Mock.UnifiedApi
149157
Test.Cardano.Db.Mock.Validate
150158

151159
build-depends: aeson

cardano-chain-gen/src/Cardano/Mock/Forging/Tx/Babbage.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ mkUTxOBabbage :: AlonzoTx StandardBabbage -> [(TxIn StandardCrypto, BabbageTxOut
462462
mkUTxOBabbage = mkUTxOAlonzo
463463

464464
mkUTxOCollBabbage ::
465-
(BabbageEraTxBody era) =>
465+
BabbageEraTxBody era =>
466466
AlonzoTx era ->
467467
[(TxIn (EraCrypto era), TxOut era)]
468468
mkUTxOCollBabbage tx = Map.toList $ unUTxO $ collOuts $ getField @"body" tx

cardano-chain-gen/src/Cardano/Mock/Query.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ queryVoteCounts txHash idx = do
199199
`innerJoin` table @Db.Tx
200200
`on` (\(vote :& tx) -> vote ^. Db.VotingProcedureTxId ==. tx ^. Db.TxId)
201201
where_ $
202-
vote ^. Db.VotingProcedureVote ==. val v
202+
vote
203+
^. Db.VotingProcedureVote
204+
==. val v
203205
&&. tx ^. Db.TxHash ==. val txHash
204206
&&. vote ^. Db.VotingProcedureIndex ==. val idx
205207
pure countRows

cardano-chain-gen/test/Main.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import System.Directory (getCurrentDirectory)
77
import System.Environment (lookupEnv, setEnv)
88
import System.FilePath ((</>))
99
import qualified Test.Cardano.Db.Mock.Property.Property as Property
10+
import qualified Test.Cardano.Db.Mock.Unit.Alonzo as Alonzo
11+
import qualified Test.Cardano.Db.Mock.Unit.Babbage as Babbage
1012
import qualified Test.Cardano.Db.Mock.Unit.Conway as Conway
1113
import Test.Tasty
1214
import Test.Tasty.QuickCheck (testProperty)
@@ -28,6 +30,8 @@ tests iom = do
2830
testGroup
2931
"cardano-chain-gen"
3032
[ Conway.unitTests iom knownMigrationsPlain
33+
, Babbage.unitTests iom knownMigrationsPlain
34+
, Alonzo.unitTests iom knownMigrationsPlain
3135
, testProperty "QSM" $ Property.prop_empty_blocks iom knownMigrationsPlain
3236
]
3337
where

cardano-chain-gen/test/Test/Cardano/Db/Mock/Config.hs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ data CommandLineArgs = CommandLineArgs
122122
, claEpochDisabled :: Bool
123123
, claHasCache :: Bool
124124
, claHasLedger :: Bool
125-
, claSkipFix :: Bool
126-
, claOnlyFix :: Bool
127125
, claForceIndexes :: Bool
128126
, claHasMultiAssets :: Bool
129127
, claHasMetadata :: Bool
@@ -286,8 +284,6 @@ mkSyncNodeParams staticDir mutableDir CommandLineArgs {..} = do
286284
, enpPGPassSource = DB.PGPassCached pgconfig
287285
, enpEpochDisabled = claEpochDisabled
288286
, enpHasCache = claHasCache
289-
, enpSkipFix = claSkipFix
290-
, enpOnlyFix = claOnlyFix
291287
, enpForceIndexes = claForceIndexes
292288
, enpHasInOut = True
293289
, enpSnEveryFollowing = 35
@@ -361,8 +357,6 @@ initCommandLineArgs =
361357
, claEpochDisabled = True
362358
, claHasCache = True
363359
, claHasLedger = True
364-
, claSkipFix = True
365-
, claOnlyFix = False
366360
, claForceIndexes = False
367361
, claHasMultiAssets = True
368362
, claHasMetadata = True
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{-# LANGUAGE DataKinds #-}
2+
{-# LANGUAGE OverloadedStrings #-}
3+
4+
module Test.Cardano.Db.Mock.Unit.Alonzo (
5+
unitTests,
6+
) where
7+
8+
import Cardano.Mock.ChainSync.Server (IOManager)
9+
import Data.Text (Text)
10+
import Test.Tasty (TestTree, testGroup)
11+
import Test.Tasty.HUnit (Assertion, testCase)
12+
13+
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Config as AlzConfig
14+
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Simple as AlzSimple
15+
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Tx as AlzTx
16+
17+
{- HLINT ignore "Reduce duplication" -}
18+
19+
unitTests :: IOManager -> [(Text, Text)] -> TestTree
20+
unitTests iom knownMigrations =
21+
testGroup
22+
"Alonzo unit tests"
23+
[ testGroup
24+
"config"
25+
[ testCase "default insert config" AlzConfig.defaultInsertConfig
26+
, testCase "insert config" AlzConfig.insertConfig
27+
]
28+
, testGroup
29+
"simple"
30+
[ test "simple forge blocks" AlzSimple.forgeBlocks
31+
, test "sync one block" AlzSimple.addSimple
32+
, test "restart db-sync" AlzSimple.restartDBSync
33+
, test "sync small chain" AlzSimple.addSimpleChain
34+
]
35+
, testGroup
36+
"blocks with txs"
37+
[ test "simple tx" AlzTx.addSimpleTx
38+
, test "consume utxo same block" AlzTx.consumeSameBlock
39+
]
40+
]
41+
where
42+
test :: String -> (IOManager -> [(Text, Text)] -> Assertion) -> TestTree
43+
test str action = testCase str (action iom knownMigrations)

0 commit comments

Comments
 (0)