From ba3d18a20b9d9f4c94edf65f0b16e03e921247bc Mon Sep 17 00:00:00 2001 From: Pablo Lamela <=> Date: Thu, 14 Mar 2024 22:17:00 +0100 Subject: [PATCH] Fix compilation errors --- cardano-testnet/src/Testnet/Components/Query.hs | 6 +++--- cardano-testnet/src/Testnet/Runtime.hs | 5 +++-- .../Cardano/Testnet/Test/Cli/Babbage/Transaction.hs | 2 +- .../Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs | 4 +++- .../Test/LedgerEvents/Gov/ProposeNewConstitutionSPO.hs | 2 +- .../Cardano/Testnet/Test/LedgerEvents/TreasuryGrowth.hs | 4 ++-- .../Cardano/Testnet/Test/SubmitApi/Babbage/Transaction.hs | 2 +- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cardano-testnet/src/Testnet/Components/Query.hs b/cardano-testnet/src/Testnet/Components/Query.hs index 444dc0dbb7a..d2bf7bf93f4 100644 --- a/cardano-testnet/src/Testnet/Components/Query.hs +++ b/cardano-testnet/src/Testnet/Components/Query.hs @@ -71,7 +71,7 @@ waitUntilEpoch waitUntilEpoch nodeConfigFile socketPath desiredEpoch = withFrozenCallStack $ do result <- runExceptT $ foldEpochState - nodeConfigFile socketPath QuickValidation desiredEpoch () (const $ pure ConditionNotMet) + nodeConfigFile socketPath QuickValidation desiredEpoch () (\_ _ _ -> pure ConditionNotMet) case result of Left (FoldBlocksApplyBlockError (TerminationEpochReached epochNo)) -> pure epochNo @@ -133,7 +133,7 @@ getEpochStateView getEpochStateView nodeConfigFile socketPath = withFrozenCallStack $ do epochStateView <- liftIO $ newIORef Nothing runInBackground . runExceptT . foldEpochState nodeConfigFile socketPath QuickValidation (EpochNo maxBound) Nothing - $ \epochState -> do + $ \epochState _ _ -> do liftIO $ writeIORef epochStateView (Just epochState) pure ConditionNotMet pure . EpochStateView $ epochStateView @@ -257,7 +257,7 @@ checkDRepsNumber' :: -> m (Maybe [L.DRepState StandardCrypto]) -- ^ The DReps when the expected number of DReps was attained. checkDRepsNumber' sbe nodeConfigFile socketPath maxEpoch expectedDRepsNb = do result <- runExceptT $ foldEpochState nodeConfigFile socketPath QuickValidation maxEpoch Nothing - $ \(AnyNewEpochState actualEra newEpochState) -> do + $ \(AnyNewEpochState actualEra newEpochState) _ _ -> do case testEquality sbe actualEra of Just Refl -> do let dreps = Map.elems $ shelleyBasedEraConstraints sbe newEpochState diff --git a/cardano-testnet/src/Testnet/Runtime.hs b/cardano-testnet/src/Testnet/Runtime.hs index acfd50c589d..ea5956880a0 100644 --- a/cardano-testnet/src/Testnet/Runtime.hs +++ b/cardano-testnet/src/Testnet/Runtime.hs @@ -324,8 +324,9 @@ startLedgerNewEpochStateLogging testnetRuntime tmpWorkspace = withFrozenCallStac (handler logFile) H.note_ $ "Started logging epoch states to to: " <> logFile where - handler :: FilePath -> AnyNewEpochState -> StateT () IO LedgerStateCondition - handler outputFp anyNewEpochState = handleException . liftIO $ do + handler :: FilePath -> AnyNewEpochState -> + SlotNo -> BlockNo -> StateT () IO LedgerStateCondition + handler outputFp anyNewEpochState _ _ = handleException . liftIO $ do appendFile outputFp $ "#### BLOCK ####" <> "\n" appendFile outputFp $ show anyNewEpochState <> "\n" pure ConditionNotMet diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/Transaction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/Transaction.hs index fa1c1820429..ded2f3c19f3 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/Transaction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/Transaction.hs @@ -118,4 +118,4 @@ txOutValue (TxOut _ v _ _) = v txOutValueLovelace ::TxOutValue era -> L.Coin txOutValueLovelace = \case TxOutValueShelleyBased sbe v -> v ^. A.adaAssetL sbe - TxOutValueByron (Lovelace v) -> L.Coin v + TxOutValueByron (L.Coin v) -> L.Coin v diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs index ec42b6b257a..7927cd29e2c 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs @@ -319,6 +319,7 @@ hprop_ledger_events_propose_new_constitution = H.integrationWorkspace "propose-n void $ evalEither eConstitutionAdopted + foldBlocksCheckProposalWasSubmitted :: TxId -- TxId of submitted tx -> Env @@ -364,8 +365,9 @@ foldBlocksCheckConstitutionWasRatified :: String -- submitted constitution hash -> String -- submitted guard rail script hash -> AnyNewEpochState + -> SlotNo -> BlockNo -> StateT s IO LedgerStateCondition -- ^ Accumulator at block i and fold status -foldBlocksCheckConstitutionWasRatified submittedConstitutionHash submittedGuardRailScriptHash anyNewEpochState = +foldBlocksCheckConstitutionWasRatified submittedConstitutionHash submittedGuardRailScriptHash anyNewEpochState _ _ = if filterRatificationState submittedConstitutionHash submittedGuardRailScriptHash anyNewEpochState then return ConditionMet else return ConditionNotMet diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitutionSPO.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitutionSPO.hs index b6b050900a6..f0ae780d074 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitutionSPO.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitutionSPO.hs @@ -240,7 +240,7 @@ getConstitutionProposal -> m (Maybe (L.GovActionId StandardCrypto)) getConstitutionProposal nodeConfigFile socketPath maxEpoch = do result <- runExceptT $ foldEpochState nodeConfigFile socketPath QuickValidation maxEpoch Nothing - $ \(AnyNewEpochState actualEra newEpochState) -> + $ \(AnyNewEpochState actualEra newEpochState) _ _ -> caseShelleyToBabbageOrConwayEraOnwards (error $ "Expected Conway era onwards, got state in " <> docToString (pretty actualEra)) (\cEra -> conwayEraOnwardsConstraints cEra $ do diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/TreasuryGrowth.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/TreasuryGrowth.hs index 7427b98dcfb..ebe796a4461 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/TreasuryGrowth.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/TreasuryGrowth.hs @@ -67,8 +67,8 @@ prop_check_if_treasury_is_growing = H.integrationRetryWorkspace 0 "growing-treas H.note_ "treasury is not growing" H.failure where - handler :: AnyNewEpochState -> StateT (Map EpochNo Integer) IO LedgerStateCondition - handler (AnyNewEpochState _ newEpochState) = do + handler :: AnyNewEpochState -> SlotNo -> BlockNo -> StateT (Map EpochNo Integer) IO LedgerStateCondition + handler (AnyNewEpochState _ newEpochState) _ _ = do let (Coin coin) = newEpochState ^. L.nesEsL . L.esAccountStateL . L.asTreasuryL epochNo = newEpochState ^. L.nesELL -- handler is executed multiple times per epoch, so we keep only the latest treasury value diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Babbage/Transaction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Babbage/Transaction.hs index 84fba48eef4..f16da81ef93 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Babbage/Transaction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Babbage/Transaction.hs @@ -223,4 +223,4 @@ txOutValue (TxOut _ v _ _) = v txOutValueLovelace ::TxOutValue era -> L.Coin txOutValueLovelace = \case TxOutValueShelleyBased sbe v -> v ^. A.adaAssetL sbe - TxOutValueByron (Lovelace v) -> L.Coin v + TxOutValueByron (L.Coin v) -> L.Coin v