Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1828 - Remove code due to hard fork - Dec 2024 #1930

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions cardano-chain-gen/cardano-chain-gen.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -130,33 +130,21 @@ test-suite cardano-chain-gen
other-modules: Test.Cardano.Db.Mock.Config
Test.Cardano.Db.Mock.Examples
Test.Cardano.Db.Mock.Property.Property
Test.Cardano.Db.Mock.UnifiedApi
Test.Cardano.Db.Mock.Unit.Alonzo
Test.Cardano.Db.Mock.Unit.Alonzo.Config
Test.Cardano.Db.Mock.Unit.Alonzo.Plutus
Test.Cardano.Db.Mock.Unit.Alonzo.PoolAndSmash
Test.Cardano.Db.Mock.Unit.Alonzo.Reward
Test.Cardano.Db.Mock.Unit.Alonzo.Simple
Test.Cardano.Db.Mock.Unit.Alonzo.Stake
Test.Cardano.Db.Mock.Unit.Alonzo.Tx
Test.Cardano.Db.Mock.Unit.Babbage
Test.Cardano.Db.Mock.Unit.Babbage.CommandLineArg.ConfigFile
Test.Cardano.Db.Mock.Unit.Babbage.CommandLineArg.EpochDisabled
Test.Cardano.Db.Mock.Unit.Babbage.Config.MigrateConsumedPruneTxOut
Test.Cardano.Db.Mock.Unit.Babbage.Config.Parse
Test.Cardano.Db.Mock.Unit.Babbage.InlineAndReference
Test.Cardano.Db.Mock.Unit.Babbage.Other
Test.Cardano.Db.Mock.Unit.Babbage.Plutus
Test.Cardano.Db.Mock.Unit.Babbage.Reward
Test.Cardano.Db.Mock.Unit.Babbage.Rollback
Test.Cardano.Db.Mock.Unit.Babbage.Simple
Test.Cardano.Db.Mock.Unit.Babbage.Stake
Test.Cardano.Db.Mock.Unit.Babbage.Tx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we want to remove ALL past era tests?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could keep some tests as a reference and some that showcase differences in the behaviour between eras. We could filter them together in a meeting.

Test.Cardano.Db.Mock.Unit.Conway
Test.Cardano.Db.Mock.Unit.Conway.CommandLineArg.ConfigFile
Test.Cardano.Db.Mock.Unit.Conway.CommandLineArg.EpochDisabled
Test.Cardano.Db.Mock.Unit.Conway.Config.JsonbInSchema
Test.Cardano.Db.Mock.Unit.Conway.Config.Parse
Test.Cardano.Db.Mock.Unit.Conway.Config.MigrateConsumedPruneTxOut
Test.Cardano.Db.Mock.Unit.Conway.Config.Parse
Test.Cardano.Db.Mock.Unit.Conway.Governance
Test.Cardano.Db.Mock.Unit.Conway.InlineAndReference
Test.Cardano.Db.Mock.Unit.Conway.Other
Expand All @@ -166,7 +154,6 @@ test-suite cardano-chain-gen
Test.Cardano.Db.Mock.Unit.Conway.Simple
Test.Cardano.Db.Mock.Unit.Conway.Stake
Test.Cardano.Db.Mock.Unit.Conway.Tx
Test.Cardano.Db.Mock.UnifiedApi
Test.Cardano.Db.Mock.Validate

build-depends: aeson
Expand Down
2 changes: 1 addition & 1 deletion cardano-chain-gen/src/Cardano/Mock/Forging/Tx/Babbage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ mkUTxOBabbage :: AlonzoTx StandardBabbage -> [(TxIn StandardCrypto, BabbageTxOut
mkUTxOBabbage = mkUTxOAlonzo

mkUTxOCollBabbage ::
(BabbageEraTxBody era) =>
BabbageEraTxBody era =>
AlonzoTx era ->
[(TxIn (EraCrypto era), TxOut era)]
mkUTxOCollBabbage tx = Map.toList $ unUTxO $ collOuts $ getField @"body" tx
Expand Down
4 changes: 3 additions & 1 deletion cardano-chain-gen/src/Cardano/Mock/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ queryVoteCounts txHash idx = do
`innerJoin` table @Db.Tx
`on` (\(vote :& tx) -> vote ^. Db.VotingProcedureTxId ==. tx ^. Db.TxId)
where_ $
vote ^. Db.VotingProcedureVote ==. val v
vote
^. Db.VotingProcedureVote
==. val v
&&. tx ^. Db.TxHash ==. val txHash
&&. vote ^. Db.VotingProcedureIndex ==. val idx
pure countRows
Expand Down
6 changes: 0 additions & 6 deletions cardano-chain-gen/test/Test/Cardano/Db/Mock/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ data CommandLineArgs = CommandLineArgs
, claEpochDisabled :: Bool
, claHasCache :: Bool
, claHasLedger :: Bool
, claSkipFix :: Bool
, claOnlyFix :: Bool
, claForceIndexes :: Bool
, claHasMultiAssets :: Bool
, claHasMetadata :: Bool
Expand Down Expand Up @@ -286,8 +284,6 @@ mkSyncNodeParams staticDir mutableDir CommandLineArgs {..} = do
, enpPGPassSource = DB.PGPassCached pgconfig
, enpEpochDisabled = claEpochDisabled
, enpHasCache = claHasCache
, enpSkipFix = claSkipFix
, enpOnlyFix = claOnlyFix
, enpForceIndexes = claForceIndexes
, enpHasInOut = True
, enpSnEveryFollowing = 35
Expand Down Expand Up @@ -361,8 +357,6 @@ initCommandLineArgs =
, claEpochDisabled = True
, claHasCache = True
, claHasLedger = True
, claSkipFix = True
, claOnlyFix = False
, claForceIndexes = False
, claHasMultiAssets = True
, claHasMetadata = True
Expand Down
69 changes: 0 additions & 69 deletions cardano-chain-gen/test/Test/Cardano/Db/Mock/Unit/Alonzo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (Assertion, testCase)

import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Config as AlzConfig
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Plutus as AlzPlutus
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.PoolAndSmash as AlzPnS
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Reward as AlzReward
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Simple as AlzSimple
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Stake as AlzStake
import qualified Test.Cardano.Db.Mock.Unit.Alonzo.Tx as AlzTx

{- HLINT ignore "Reduce duplication" -}
Expand All @@ -41,71 +37,6 @@ unitTests iom knownMigrations =
[ test "simple tx" AlzTx.addSimpleTx
, test "consume utxo same block" AlzTx.consumeSameBlock
]
, testGroup
"stake addresses"
[ test "(de)registrations" AlzStake.registrationTx
, test "(de)registrations in same block" AlzStake.registrationsSameBlock
, test "(de)registrations in same tx" AlzStake.registrationsSameTx
, test "stake address pointers" AlzStake.stakeAddressPtr
, test "stake address pointers deregistration" AlzStake.stakeAddressPtrDereg
, test "stake address pointers. Use before registering." AlzStake.stakeAddressPtrUseBefore
]
, testGroup
"rewards"
[ test "rewards simple" AlzReward.simpleRewards
, test "rewards with deregistration" AlzReward.rewardsDeregistration
, test "rewards with reregistration. Fixed in Babbage." AlzReward.rewardsReregistration
, test "Mir Cert" AlzReward.mirReward
, test "Mir rollback" AlzReward.mirRewardRollback
, test "Mir Cert deregistration" AlzReward.mirRewardDereg
, -- , test "test rewards empty last part of epoch" rewardsEmptyChainLast
-- , test "test delta rewards" rewardsDelta -- See the same test on Babbage for the reason it was disabled.
test "rollback on epoch boundary" AlzReward.rollbackBoundary
, test "single MIR Cert multiple outputs" AlzReward.singleMIRCertMultiOut
]
, testGroup
"stake distribution"
[ test "stake distribution from genesis" AlzStake.stakeDistGenesis
, test "2000 delegations" AlzStake.delegations2000
, test "2001 delegations" AlzStake.delegations2001
, test "8000 delegations" AlzStake.delegations8000
, test "many delegations" AlzStake.delegationsMany
, test "many delegations, sparse chain" AlzStake.delegationsManyNotDense
]
, testGroup
"plutus spend scripts"
[ test "simple script lock" AlzPlutus.simpleScript
, test "unlock script in same block" AlzPlutus.unlockScriptSameBlock
, test "failed script" AlzPlutus.failedScript
, test "failed script in same block" AlzPlutus.failedScriptSameBlock
, test "multiple scripts unlocked" AlzPlutus.multipleScripts
, test "multiple scripts unlocked same block" AlzPlutus.multipleScriptsSameBlock
, test "multiple scripts failed" AlzPlutus.multipleScriptsFailed
, test "multiple scripts failed same block" AlzPlutus.multipleScriptsFailedSameBlock
]
, testGroup
"plutus cert scripts"
[ test "stake scripts" AlzPlutus.registrationScriptTx
, test "stake scripts deregistration" AlzPlutus.deregistrationScriptTx
, test "multiple stake scripts deregistration" AlzPlutus.deregistrationsScriptTxs
, test "multiple stake scripts deregistration in same tx" AlzPlutus.deregistrationsScriptTx
, test "multiple stake scripts deregistration in same tx missing redeemer 1" AlzPlutus.deregistrationsScriptTx'
, test "multiple stake scripts deregistration in same tx missing redeemer 2" AlzPlutus.deregistrationsScriptTx''
]
, testGroup
"MultiAssets plutus scripts"
[ test "mint simple multi asset" AlzPlutus.mintMultiAsset
, test "mint many multi assets" AlzPlutus.mintMultiAssets
, test "swap many multi assets" AlzPlutus.swapMultiAssets
]
, testGroup
"pools and smash"
[ test "pool registration" AlzPnS.poolReg
, test "query pool that's not registered" AlzPnS.nonexistantPoolQuery
, test "pool deregistration" AlzPnS.poolDeReg
, test "pool multiple deregistration" AlzPnS.poolDeRegMany
, test "delist pool" AlzPnS.poolDelist
]
]
where
test :: String -> (IOManager -> [(Text, Text)] -> Assertion) -> TestTree
Expand Down
Loading
Loading