From 7c1b7e8f662d229336cfa47f86ac77cc3c5fcbb6 Mon Sep 17 00:00:00 2001 From: Jordan Millar Date: Mon, 27 May 2024 08:48:22 -0400 Subject: [PATCH] Rebase changes --- cardano-testnet/src/Testnet/Components/Query.hs | 8 ++------ .../Cardano/Testnet/Test/Gov/NoConfidence.hs | 8 ++++---- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cardano-testnet/src/Testnet/Components/Query.hs b/cardano-testnet/src/Testnet/Components/Query.hs index a85e6ea79aa..f3a09f7fdb8 100644 --- a/cardano-testnet/src/Testnet/Components/Query.hs +++ b/cardano-testnet/src/Testnet/Components/Query.hs @@ -49,12 +49,8 @@ import qualified Cardano.Ledger.Conway.PParams as L import qualified Cardano.Ledger.Shelley.LedgerState as L import qualified Cardano.Ledger.UTxO as L -<<<<<<< HEAD import Control.Exception.Safe (MonadCatch) import Control.Monad -======= -import Control.Monad (void) ->>>>>>> 0d8b07527 (Replace usage of resourcet's allocate with resourceForkWith as this is) import Control.Monad.Trans.Resource import Control.Monad.Trans.State.Strict (put) import Data.Bifunctor (bimap) @@ -258,8 +254,8 @@ getEpochStateView getEpochStateView nodeConfigFile socketPath = withFrozenCallStack $ do epochStateView <- H.evalIO $ newIORef Nothing runInBackground (return ()) . runExceptT . foldEpochState nodeConfigFile socketPath QuickValidation (EpochNo maxBound) Nothing - $ \epochState _slotNb _blockNb -> do - liftIO $ writeIORef epochStateView (Just epochState) + $ \epochState slotNumber blockNumber -> do + liftIO . writeIORef epochStateView $ Just (epochState, slotNumber, blockNumber) pure ConditionNotMet pure $ EpochStateView nodeConfigFile socketPath epochStateView diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs index e9df4844566..4366cf82c58 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/NoConfidence.hs @@ -131,7 +131,7 @@ hprop_gov_no_confidence = integrationWorkspace "no-confidence" $ \tempAbsBasePat epochStateView <- getEpochStateView configurationFile (File socketPath) - H.nothingFailM $ watchEpochStateUpdate epochStateView (EpochInterval 3) $ \(anyNewEpochState, _, _) -> + H.nothingFailM $ watchEpochStateUpdate epochStateView (EpochInterval 3) $ \anyNewEpochState-> pure $ committeeIsPresent True anyNewEpochState -- Step 2. Propose motion of no confidence. DRep and SPO voting thresholds must be met. @@ -223,11 +223,11 @@ hprop_gov_no_confidence = integrationWorkspace "no-confidence" $ \tempAbsBasePat -- Step 4. We confirm the no confidence motion has been ratified by checking -- for an empty constitutional committee. - H.nothingFailM $ watchEpochStateView epochStateView (return . committeeIsPresent False) (EpochInterval 10) + H.nothingFailM $ watchEpochStateUpdate epochStateView (EpochInterval 10) (return . committeeIsPresent False) -- | Checks if the committee is empty or not. -committeeIsPresent :: Bool -> AnyNewEpochState -> Maybe () -committeeIsPresent committeeExists (AnyNewEpochState sbe newEpochState) = +committeeIsPresent :: Bool -> (AnyNewEpochState, SlotNo, BlockNo) -> Maybe () +committeeIsPresent committeeExists (AnyNewEpochState sbe newEpochState, _, _) = caseShelleyToBabbageOrConwayEraOnwards (const $ error "Constitutional committee does not exist pre-Conway era") (const $ let mCommittee = newEpochState