From 0377a220d4243d5c7f974e875fb69a4f5675521e Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Tue, 4 Aug 2026 21:39:23 +0000 Subject: [PATCH 1/2] Clean up Conf constructor naming in cardano-testnet Testnet.Start.Types had three constructors for Conf whose names did not communicate how they differ: mkConf, mkConfig and mkConfigAbs. Remove mkConf. Its only difference with the pure mkConfig was noting the directory in the test log, which was redundant: every call site passes a workspace path that hedgehog-extras' 'workspace' already annotates on creation ("Workspace: "). Test code now uses mkConfig directly, which is now exported (and re-exported from Cardano.Testnet in place of mkConf). The call sites that additionally wrapped mkConf in H.noteShowM keep their Conf annotation via H.noteShow. Rename mkConfigAbs to mkConfigAbsolute, and document that, besides making the path absolute, it also creates the directory if it does not exist yet. --- ..._palas_cleanup_conf_constructor_naming.yml | 6 +++++ .../test/Spec/Chairman/Cardano.hs | 2 +- ..._palas_cleanup_conf_constructor_naming.yml | 12 +++++++++ cardano-testnet/src/Cardano/Testnet.hs | 2 +- cardano-testnet/src/Parsers/Run.hs | 6 ++--- cardano-testnet/src/Testnet/Property/Run.hs | 7 +++-- cardano-testnet/src/Testnet/Start/Types.hs | 26 ++++++------------- .../Testnet/Test/Api/TxReferenceInputDatum.hs | 2 +- .../Testnet/Test/Cli/Conway/StakeSnapshot.hs | 2 +- .../Cardano/Testnet/Test/Cli/KesPeriodInfo.hs | 5 ++-- .../Testnet/Test/Cli/LeadershipSchedule.hs | 2 +- .../Testnet/Test/Cli/Plutus/BuildRaw.hs | 2 +- .../Test/Cli/Plutus/CostCalculation.hs | 6 ++--- .../Cli/Plutus/MultiAssetReturnCollateral.hs | 2 +- .../Testnet/Test/Cli/Plutus/Scripts.hs | 4 +-- .../Cardano/Testnet/Test/Cli/Query.hs | 3 +-- .../Testnet/Test/Cli/QuerySlotNumber.hs | 2 +- .../Cli/Scripts/Simple/CostCalculation.hs | 2 +- .../Testnet/Test/Cli/Scripts/Simple/Mint.hs | 2 +- .../Cardano/Testnet/Test/Cli/StakeSnapshot.hs | 2 +- .../Cardano/Testnet/Test/Cli/Transaction.hs | 2 +- .../Test/Cli/Transaction/BuildEstimate.hs | 2 +- .../RegisterDeregisterStakeAddress.hs | 2 +- .../Test/Cli/Transaction/WithdrawalReward.hs | 4 +-- .../Cardano/Testnet/Test/DumpConfig.hs | 2 +- .../Cardano/Testnet/Test/FoldEpochState.hs | 2 +- .../Testnet/Test/Gov/CommitteeAddNew.hs | 2 +- .../Cardano/Testnet/Test/Gov/DRepActivity.hs | 2 +- .../Cardano/Testnet/Test/Gov/DRepDeposit.hs | 2 +- .../Testnet/Test/Gov/DRepRetirement.hs | 2 +- .../Testnet/Test/Gov/GovActionTimeout.hs | 2 +- .../Cardano/Testnet/Test/Gov/InfoAction.hs | 2 +- .../Cardano/Testnet/Test/Gov/NoConfidence.hs | 2 +- .../Testnet/Test/Gov/PParamChangeFailsSPO.hs | 2 +- .../Testnet/Test/Gov/PredefinedAbstainDRep.hs | 2 +- .../Test/Gov/ProposeNewConstitution.hs | 2 +- .../Test/Gov/ProposeNewConstitutionSPO.hs | 3 +-- .../Test/Gov/Transaction/HashMismatch.hs | 2 +- .../Testnet/Test/Gov/TreasuryDonation.hs | 3 +-- .../Testnet/Test/Gov/TreasuryGrowth.hs | 2 +- .../Testnet/Test/Gov/TreasuryWithdrawal.hs | 2 +- .../Cardano/Testnet/Test/MainnetParams.hs | 2 +- .../Cardano/Testnet/Test/Node/Shutdown.hs | 6 ++--- .../Cardano/Testnet/Test/P2PTopology.hs | 4 +-- .../Cardano/Testnet/Test/Rpc/Eval.hs | 2 +- .../Cardano/Testnet/Test/Rpc/Query.hs | 2 +- .../Cardano/Testnet/Test/Rpc/SearchUtxos.hs | 2 +- .../Cardano/Testnet/Test/Rpc/Transaction.hs | 2 +- .../Cardano/Testnet/Test/RunTestnet.hs | 4 +-- .../Cardano/Testnet/Test/SanityCheck.hs | 2 +- .../Testnet/Test/SubmitApi/Transaction.hs | 2 +- .../Cardano/Testnet/Test/UpdateTimeStamps.hs | 2 +- 52 files changed, 88 insertions(+), 85 deletions(-) create mode 100644 cardano-node-chairman/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml create mode 100644 cardano-testnet/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml diff --git a/cardano-node-chairman/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml b/cardano-node-chairman/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml new file mode 100644 index 00000000000..432870afc03 --- /dev/null +++ b/cardano-node-chairman/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml @@ -0,0 +1,6 @@ +pr: 6637 +kind: + - test +description: | + - Adapted the chairman test to the removal of `mkConf` from `cardano-testnet`: + use the pure `mkConfig` instead. diff --git a/cardano-node-chairman/test/Spec/Chairman/Cardano.hs b/cardano-node-chairman/test/Spec/Chairman/Cardano.hs index ce64c4e0a5a..4657960efac 100644 --- a/cardano-node-chairman/test/Spec/Chairman/Cardano.hs +++ b/cardano-node-chairman/test/Spec/Chairman/Cardano.hs @@ -17,7 +17,7 @@ import Spec.Chairman.Chairman (chairmanOver) hprop_chairman :: H.Property hprop_chairman = integrationRetryWorkspace 2 "cardano-chairman" $ \tempAbsPath' -> H.runWithDefaultWatchdog_ $ do - conf <- mkConf tempAbsPath' + let conf = mkConfig tempAbsPath' let creationOptions = def{ creationNodes = cardanoDefaultTestnetNodesWithOptions } allNodes <- testnetNodes <$> createAndRunTestnet creationOptions def conf diff --git a/cardano-testnet/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml b/cardano-testnet/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml new file mode 100644 index 00000000000..1993471cf22 --- /dev/null +++ b/cardano-testnet/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml @@ -0,0 +1,12 @@ +pr: 6637 +kind: + - breaking +description: | + - Cleaned up the naming of the `Conf` constructors in `Testnet.Start.Types`: + - Removed `mkConf`. Its only difference with `mkConfig` was noting the path in the test log, + which was redundant: every call site passes a workspace path that hedgehog-extras' + `workspace` already annotates on creation. Test code now uses the pure `mkConfig` + directly, which is now exported (and re-exported from `Cardano.Testnet` in place of + `mkConf`). + - Renamed `mkConfigAbs` to `mkConfigAbsolute`, and documented that, besides making the + path absolute, it also creates the directory if it doesn't exist yet. diff --git a/cardano-testnet/src/Cardano/Testnet.hs b/cardano-testnet/src/Cardano/Testnet.hs index 0c0059789a7..6ee21314488 100644 --- a/cardano-testnet/src/Cardano/Testnet.hs +++ b/cardano-testnet/src/Cardano/Testnet.hs @@ -25,7 +25,7 @@ module Cardano.Testnet ( TmpAbsolutePath(..), NodeConfiguration, NodeConfigurationYaml, - mkConf, + mkConfig, makeLogDir, makeSocketDir, makeTmpBaseAbsPath, diff --git a/cardano-testnet/src/Parsers/Run.hs b/cardano-testnet/src/Parsers/Run.hs index 1d5971dadac..2d363ed9567 100644 --- a/cardano-testnet/src/Parsers/Run.hs +++ b/cardano-testnet/src/Parsers/Run.hs @@ -64,7 +64,7 @@ createEnvOptions CardanoTestnetCreateEnvOptions { createEnvCreationOptions=creationOptions , createEnvOutputDir=outputDir } = do - conf <- mkConfigAbs outputDir + conf <- mkConfigAbsolute outputDir void $ createTestnetEnv creationOptions -- Do not add hashes to the main config file, so that genesis files @@ -78,7 +78,7 @@ runCardanoOptions = \case -- It is not necessary to update timestamps here, because -- the genesis files will be created with up-to-date stamps already. let dirName = fromMaybe "testnet" noEnvOutputDir - conf <- mkConfigAbs dirName + conf <- mkConfigAbsolute dirName runSimpleApp . runResourceT $ do logInfo $ "Creating environment: " <> display (tempAbsPath conf) createTestnetEnv noEnvCreationOptions conf @@ -90,7 +90,7 @@ runCardanoOptions = \case -- Run cardano-testnet in the sandbox provided by the user let dirName = envPath fromEnvOptions unlessM (doesDirectoryExist dirName) $ error $ "The provided path does not exist or is not a directory: " <> dirName - conf <- mkConfigAbs dirName + conf <- mkConfigAbsolute dirName nodes <- readNodesWithOptionsFromEnv (unTmpAbsPath (tempAbsPath conf)) runSimpleApp . runResourceT $ do logInfo $ "Starting testnet in environment: " <> display (tempAbsPath conf) diff --git a/cardano-testnet/src/Testnet/Property/Run.hs b/cardano-testnet/src/Testnet/Property/Run.hs index 16fba5a0aca..144515e46a3 100644 --- a/cardano-testnet/src/Testnet/Property/Run.hs +++ b/cardano-testnet/src/Testnet/Property/Run.hs @@ -33,7 +33,7 @@ import Text.Printf (printf) import Testnet.Process.RunIO import Testnet.Property.Util (integration, integrationWorkspace) -import Testnet.Start.Types (Conf, mkConf) +import Testnet.Start.Types (Conf, mkConfig) import Testnet.Types (TestnetNode (..), TestnetRuntime (..), spoNodes) @@ -109,7 +109,7 @@ testnetProperty env runTn = case env of NoUserProvidedEnv -> do integrationWorkspace "testnet" $ \workspaceDir -> do - mkConf workspaceDir >>= forkAndRunTestnet + forkAndRunTestnet $ mkConfig workspaceDir UserProvidedEnv userOutputDir -> integration $ do absUserOutputDir <- H.evalIO $ makeAbsolute userOutputDir @@ -120,8 +120,7 @@ testnetProperty env runTn = else do liftIOAnnotated $ createDirectory absUserOutputDir H.note_ $ "Created " <> absUserOutputDir - conf <- mkConf absUserOutputDir - forkAndRunTestnet conf + forkAndRunTestnet $ mkConfig absUserOutputDir where forkAndRunTestnet conf = do -- Fork a thread to keep alive indefinitely any resources allocated by testnet. diff --git a/cardano-testnet/src/Testnet/Start/Types.hs b/cardano-testnet/src/Testnet/Start/Types.hs index 47b1e4d96c7..e93dd031339 100644 --- a/cardano-testnet/src/Testnet/Start/Types.hs +++ b/cardano-testnet/src/Testnet/Start/Types.hs @@ -44,8 +44,8 @@ module Testnet.Start.Types , GenesisHashesPolicy (..) , NodeConfiguration , NodeConfigurationYaml - , mkConf - , mkConfigAbs + , mkConfig + , mkConfigAbsolute ) where import Cardano.Api hiding (cardanoEra) @@ -65,16 +65,12 @@ import Data.List.NonEmpty (NonEmpty ((:|))) import qualified Data.List.NonEmpty as NEL import qualified Data.Text as Text import Data.Word -import GHC.Stack import qualified Network.HTTP.Simple as HTTP import System.Directory (createDirectory, doesDirectoryExist, makeAbsolute) import System.FilePath (addTrailingPathSeparator) import Testnet.Filepath -import Hedgehog (MonadTest) -import qualified Hedgehog.Extras as H - -- | The default value for the --testnet-magic option for `cardano-testnet` defaultTestnetMagic :: Int defaultTestnetMagic = 42 @@ -323,15 +319,9 @@ data Conf = Conf , updateTimestamps :: UpdateTimestamps } deriving (Eq, Show) --- | Same as mkConfig except that it renders the path --- when failing in a property test. -mkConf :: (HasCallStack, MonadTest m) => FilePath -> m Conf -mkConf tempAbsPath' = withFrozenCallStack $ do - H.note_ tempAbsPath' - pure $ mkConfig tempAbsPath' - -- | Create a 'Conf' from a temporary absolute path, with Genesis Hashes enabled --- and updating time stamps disabled. +-- and updating time stamps disabled. This function is pure: the directory is +-- neither created nor checked for existence. mkConfig :: FilePath -> Conf mkConfig tempAbsPath' = Conf @@ -340,10 +330,10 @@ mkConfig tempAbsPath' = , updateTimestamps = DontUpdateTimestamps } --- | Create a 'Conf' from an absolute path, with Genesis Hashes enabled --- and updating time stamps disabled. -mkConfigAbs :: FilePath -> IO Conf -mkConfigAbs userOutputDir = do +-- | Like 'mkConfig', except that the path is first made absolute, and the +-- directory is created if it doesn't exist yet. +mkConfigAbsolute :: FilePath -> IO Conf +mkConfigAbsolute userOutputDir = do absUserOutputDir <- makeAbsolute userOutputDir dirExists <- doesDirectoryExist absUserOutputDir let conf = mkConfig absUserOutputDir diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Api/TxReferenceInputDatum.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Api/TxReferenceInputDatum.hs index 97c46c57a91..8d308aeb752 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Api/TxReferenceInputDatum.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Api/TxReferenceInputDatum.hs @@ -56,7 +56,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H -- This test tests that such datums are made available to the script. hprop_tx_refin_datum :: Property hprop_tx_refin_datum = integrationRetryWorkspace 2 "api-tx-refin-dat" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf{tempAbsPath} <- mkConf tempAbsBasePath' + let conf@Conf{tempAbsPath} = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath let era = Exp.ConwayEra diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/StakeSnapshot.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/StakeSnapshot.hs index f76f2cb1c2a..309ff525b27 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/StakeSnapshot.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/StakeSnapshot.hs @@ -32,7 +32,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H hprop_stakeSnapshot :: Property hprop_stakeSnapshot = integrationRetryWorkspace 2 "conway-stake-snapshot" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath' diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs index f099ec51312..2de2402f3f8 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs @@ -61,9 +61,8 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H hprop_kes_period_info :: Property hprop_kes_period_info = integrationRetryWorkspace 2 "kes-period-info" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } - -- TODO: Move yaml filepath specification into individual node options - <- mkConf tempAbsBasePath' + -- TODO: Move yaml filepath specification into individual node options + let conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } = mkConfig tempAbsBasePath' let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath ceo = ConwayEraOnwardsConway diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs index 00be5b1a35e..7b058253e39 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs @@ -64,7 +64,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H hprop_leadershipSchedule :: Property hprop_leadershipSchedule = integrationRetryWorkspace 2 "leadership-schedule" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } = mkConfig tempAbsBasePath' let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath ceo = ConwayEraOnwardsConway sbe = convert ceo diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/BuildRaw.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/BuildRaw.hs index c10d47efc80..2adfa564aa3 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/BuildRaw.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/BuildRaw.hs @@ -44,7 +44,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H hprop_build_raw_ref_script_spend :: Property hprop_build_raw_ref_script_spend = integrationRetryWorkspace 2 "build-raw-ref-script" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf{tempAbsPath} <- mkConf tempAbsBasePath' + let conf@Conf{tempAbsPath} = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/CostCalculation.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/CostCalculation.hs index 2721030c6f4..ae06da8d20a 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/CostCalculation.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/CostCalculation.hs @@ -57,7 +57,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H hprop_ref_plutus_cost_calculation :: Property hprop_ref_plutus_cost_calculation = integrationRetryWorkspace 2 "ref-plutus-script" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf{tempAbsPath} <- mkConf tempAbsBasePath' + let conf@Conf{tempAbsPath} = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" @@ -213,7 +213,7 @@ hprop_ref_plutus_cost_calculation = integrationRetryWorkspace 2 "ref-plutus-scri hprop_included_plutus_cost_calculation :: Property hprop_included_plutus_cost_calculation = integrationRetryWorkspace 2 "included-plutus-script" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf{tempAbsPath} <- mkConf tempAbsBasePath' + let conf@Conf{tempAbsPath} = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" @@ -325,7 +325,7 @@ hprop_included_plutus_cost_calculation = integrationRetryWorkspace 2 "included-p hprop_included_simple_script_cost_calculation :: Property hprop_included_simple_script_cost_calculation = integrationRetryWorkspace 2 "included-simple-script" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf{tempAbsPath} <- mkConf tempAbsBasePath' + let conf@Conf{tempAbsPath} = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/MultiAssetReturnCollateral.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/MultiAssetReturnCollateral.hs index f43705214b2..c2618072064 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/MultiAssetReturnCollateral.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/MultiAssetReturnCollateral.hs @@ -36,7 +36,7 @@ import qualified Hedgehog.Extras as H -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/Collateral With Multiassets/"'@ hprop_collateral_with_tokens :: Property hprop_collateral_with_tokens = integrationRetryWorkspace 2 "collateral-with-tokens" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/Scripts.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/Scripts.hs index 33bef8c9eb1..e53f6891a6d 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/Scripts.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Plutus/Scripts.hs @@ -48,7 +48,7 @@ import qualified Hedgehog.Extras as H -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/PlutusV3 purposes/"'@ hprop_plutus_purposes_v3 :: Property hprop_plutus_purposes_v3 = integrationRetryWorkspace 2 "all-plutus-script-purposes" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" @@ -198,7 +198,7 @@ hprop_plutus_purposes_v3 = integrationRetryWorkspace 2 "all-plutus-script-purpos -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/PlutusV2 transaction with two script certs/"'@ hprop_tx_two_script_certs_v2 :: Property hprop_tx_two_script_certs_v2 = integrationRetryWorkspace 2 "tx-2-script-certs" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs index bcb79e2e53d..ccb27d2d3d8 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs @@ -78,8 +78,7 @@ import RIO (runRIO) -- RECREATE_GOLDEN_FILES=1 as its prefix hprop_cli_queries :: Property hprop_cli_queries = integrationRetryWorkspace 2 "cli-queries" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } - <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } = mkConfig tempAbsBasePath' let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath let sbe = ShelleyBasedEraConway diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/QuerySlotNumber.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/QuerySlotNumber.hs index f369b74139d..17ac003cf76 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/QuerySlotNumber.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/QuerySlotNumber.hs @@ -40,7 +40,7 @@ import qualified Hedgehog.Internal.Property as H hprop_querySlotNumber :: Property hprop_querySlotNumber = integrationRetryWorkspace 2 "query-slot-number" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf <- mkConf tempAbsBasePath' + let conf = mkConfig tempAbsBasePath' let tempBaseAbsPath' = makeTmpBaseAbsPath $ tempAbsPath conf diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Scripts/Simple/CostCalculation.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Scripts/Simple/CostCalculation.hs index 44d54fd3ff3..ada3f3419f9 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Scripts/Simple/CostCalculation.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Scripts/Simple/CostCalculation.hs @@ -42,7 +42,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H hprop_ref_simple_script_mint :: Property hprop_ref_simple_script_mint = integrationRetryWorkspace 2 "ref-simple-script" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf{tempAbsPath} <- mkConf tempAbsBasePath' + let conf@Conf{tempAbsPath} = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Scripts/Simple/Mint.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Scripts/Simple/Mint.hs index 05d49596d23..9a17f8c8fd8 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Scripts/Simple/Mint.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Scripts/Simple/Mint.hs @@ -39,7 +39,7 @@ import qualified Hedgehog.Extras as H -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/Simple Script.Simple Script Mint/"'@ hprop_simple_script_mint :: Property hprop_simple_script_mint = integrationRetryWorkspace 2 "simple-script-mint" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/StakeSnapshot.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/StakeSnapshot.hs index e4e0a6f5c3b..819a86350a9 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/StakeSnapshot.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/StakeSnapshot.hs @@ -33,7 +33,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H hprop_stakeSnapshot :: Property hprop_stakeSnapshot = integrationRetryWorkspace 2 "stake-snapshot" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tempAbsPath' diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs index 081da7e86bc..8891a429ba8 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction.hs @@ -45,7 +45,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H hprop_transaction :: Property hprop_transaction = integrationRetryWorkspace 2 "simple transaction build" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/BuildEstimate.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/BuildEstimate.hs index 5e3f2bdec67..cc7c9259967 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/BuildEstimate.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/BuildEstimate.hs @@ -40,7 +40,7 @@ import qualified Hedgehog.Extras as H hprop_tx_build_estimate :: Property hprop_tx_build_estimate = integrationRetryWorkspace 2 "transaction-build-estimate" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/RegisterDeregisterStakeAddress.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/RegisterDeregisterStakeAddress.hs index 3bcca8af16b..1af5e73def1 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/RegisterDeregisterStakeAddress.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/RegisterDeregisterStakeAddress.hs @@ -43,7 +43,7 @@ import qualified Hedgehog.Extras as H hprop_tx_register_deregister_stake_address :: Property hprop_tx_register_deregister_stake_address = integrationRetryWorkspace 2 "register-deregister-stake-addr" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/WithdrawalReward.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/WithdrawalReward.hs index ebc0e0840a0..234ff7ae852 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/WithdrawalReward.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Transaction/WithdrawalReward.hs @@ -52,7 +52,7 @@ import qualified Hedgehog.Extras as H -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/transaction build with withdrawal/"'@ hprop_tx_withdrawal_reward :: Property hprop_tx_withdrawal_reward = integrationRetryWorkspace 2 "tx-withdrawal-reward" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath @@ -127,7 +127,7 @@ hprop_tx_withdrawal_reward = integrationRetryWorkspace 2 "tx-withdrawal-reward" -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/transaction build with plutus withdrawal/"'@ hprop_tx_withdrawal_reward_plutus_v3 :: Property hprop_tx_withdrawal_reward_plutus_v3 = integrationRetryWorkspace 2 "tx-withdrawal-reward-plutus-v3" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/DumpConfig.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/DumpConfig.hs index 3aa8aa190fd..38c5dacaedb 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/DumpConfig.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/DumpConfig.hs @@ -41,7 +41,7 @@ hprop_dump_config = integrationRetryWorkspace 2 "dump-config-files" $ \tmpDir -> shelleyGenesisFile = tmpDir "shelley-genesis.json" -- Generate the sandbox - conf <- mkConf tmpDir + let conf = mkConfig tmpDir liftToIntegration $ createTestnetEnv creationOptions diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldEpochState.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldEpochState.hs index 990f4260ea3..8d1d2acf66e 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldEpochState.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldEpochState.hs @@ -26,7 +26,7 @@ import qualified Hedgehog.Extras.Test as H prop_foldEpochState :: H.Property prop_foldEpochState = integrationRetryWorkspace 2 "foldEpochState" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf <- TN.mkConf tempAbsBasePath' + let conf = TN.mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath $ tempAbsPath conf sbe = ShelleyBasedEraConway diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/CommitteeAddNew.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/CommitteeAddNew.hs index 088570c31f2..01e54602d91 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/CommitteeAddNew.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/CommitteeAddNew.hs @@ -59,7 +59,7 @@ import qualified Hedgehog.Extras as H -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/Committee Add New/"'@ hprop_constitutional_committee_add_new :: Property hprop_constitutional_committee_add_new = integrationRetryWorkspace 2 "constitutional-committee-add-new" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs index 3384ac1013d..45e9b169222 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepActivity.hs @@ -53,7 +53,7 @@ import qualified Hedgehog.Extras as H hprop_check_drep_activity :: Property hprop_check_drep_activity = integrationRetryWorkspace 2 "test-activity" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog $ \watchdog -> do -- Start a local test net - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepDeposit.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepDeposit.hs index f0db3127b94..a9ae1f963f2 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepDeposit.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepDeposit.hs @@ -36,7 +36,7 @@ hprop_ledger_events_drep_deposits :: Property hprop_ledger_events_drep_deposits = integrationRetryWorkspace 2 "drep-deposits" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepRetirement.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepRetirement.hs index 46c74ce42fc..f3026c1dab0 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepRetirement.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/DRepRetirement.hs @@ -43,7 +43,7 @@ sbe = ShelleyBasedEraConway hprop_drep_retirement :: Property hprop_drep_retirement = integrationRetryWorkspace 2 "drep-retirement" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net - conf@Conf { tempAbsPath } <- H.noteShowM $ mkConf tempAbsBasePath' + conf@Conf { tempAbsPath } <- H.noteShow $ mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/GovActionTimeout.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/GovActionTimeout.hs index bd72aa94209..85e5166d929 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/GovActionTimeout.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/GovActionTimeout.hs @@ -42,7 +42,7 @@ hprop_check_gov_action_timeout :: Property hprop_check_gov_action_timeout = integrationRetryWorkspace 2 "gov-action-timeout" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/InfoAction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/InfoAction.hs index e460d81a808..09f80971221 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/InfoAction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/InfoAction.hs @@ -53,7 +53,7 @@ hprop_ledger_events_info_action :: Property hprop_ledger_events_info_action = integrationRetryWorkspace 2 "info-hash" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- H.noteShowM $ mkConf tempAbsBasePath' + conf@Conf { tempAbsPath } <- H.noteShow $ mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath 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 a8ded2569a8..72944771c16 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 @@ -57,7 +57,7 @@ import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO hprop_gov_no_confidence :: Property hprop_gov_no_confidence = integrationRetryWorkspace 2 "no-confidence" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs index 5a4661f5429..21fe61dc378 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PParamChangeFailsSPO.hs @@ -51,7 +51,7 @@ hprop_check_pparam_fails_spo :: Property hprop_check_pparam_fails_spo = integrationRetryWorkspace 2 "test-pparam-spo" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PredefinedAbstainDRep.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PredefinedAbstainDRep.hs index 22d6d02397f..5d8af53ed9e 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PredefinedAbstainDRep.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/PredefinedAbstainDRep.hs @@ -66,7 +66,7 @@ import qualified Hedgehog.Extras as H hprop_check_predefined_abstain_drep :: Property hprop_check_predefined_abstain_drep = H.integrationRetryWorkspace 2 "test-activity" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs index a9846c95997..4bb2c493527 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitution.hs @@ -65,7 +65,7 @@ import qualified Hedgehog.Extras as H hprop_ledger_events_propose_new_constitution :: Property hprop_ledger_events_propose_new_constitution = integrationRetryWorkspace 2 "propose-new-constitution" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs index 260222d56f2..b94a535fd88 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs @@ -49,8 +49,7 @@ import qualified Hedgehog.Extras as H -- @cabal test cardano-testnet-test --test-options '-p "/Propose New Constitution SPO/"'@ hprop_ledger_events_propose_new_constitution_spo :: Property hprop_ledger_events_propose_new_constitution_spo = integrationRetryWorkspace 2 "propose-new-constitution-spo" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } - <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } = mkConfig tempAbsBasePath' let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath let ceo = ConwayEraOnwardsConway diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/Transaction/HashMismatch.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/Transaction/HashMismatch.hs index d14caa497b1..296baa72ca8 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/Transaction/HashMismatch.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/Transaction/HashMismatch.hs @@ -41,7 +41,7 @@ import qualified Hedgehog.Extras as H hprop_transaction_build_wrong_hash :: Property hprop_transaction_build_wrong_hash = integrationRetryWorkspace 2 "wrong-hash" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- H.noteShowM $ mkConf tempAbsBasePath' + conf@Conf { tempAbsPath } <- H.noteShow $ mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryDonation.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryDonation.hs index c982be1152b..58b98f72396 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryDonation.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryDonation.hs @@ -41,8 +41,7 @@ import qualified Hedgehog.Extras as H -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/Treasury Donation/"'@ hprop_ledger_events_treasury_donation :: Property hprop_ledger_events_treasury_donation = integrationRetryWorkspace 2 "treasury-donation" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } - <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } = mkConfig tempAbsBasePath' let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath let ceo = ConwayEraOnwardsConway diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryGrowth.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryGrowth.hs index f0109900e5a..45fe585ab0e 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryGrowth.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryGrowth.hs @@ -37,7 +37,7 @@ import qualified Hedgehog.Extras.Test as H prop_check_if_treasury_is_growing :: H.Property prop_check_if_treasury_is_growing = integrationRetryWorkspace 2 "growing-treasury" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start testnet - conf@Conf{tempAbsPath=TmpAbsolutePath tempAbsPath'} <- TN.mkConf tempAbsBasePath' + let conf@Conf{tempAbsPath=TmpAbsolutePath tempAbsPath'} = TN.mkConfig tempAbsBasePath' let tempBaseAbsPath = makeTmpBaseAbsPath $ tempAbsPath conf let era = ConwayEra diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryWithdrawal.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryWithdrawal.hs index acb7cffee4d..608ffe90d7e 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryWithdrawal.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/TreasuryWithdrawal.hs @@ -56,7 +56,7 @@ import qualified Hedgehog.Extras as H hprop_ledger_events_treasury_withdrawal:: Property hprop_ledger_events_treasury_withdrawal = integrationRetryWorkspace 2 "treasury-withdrawal" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf { tempAbsPath } <- H.noteShowM $ mkConf tempAbsBasePath' + conf@Conf { tempAbsPath } <- H.noteShow $ mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/MainnetParams.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/MainnetParams.hs index d486c492be5..3c8f0bbabc8 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/MainnetParams.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/MainnetParams.hs @@ -37,7 +37,7 @@ hprop_mainnet_params = integrationRetryWorkspace 2 "mainnet-params" $ \tmpDir -> } -- Generate the sandbox - conf <- mkConf tmpDir + let conf = mkConfig tmpDir liftToIntegration $ createTestnetEnv creationOptions conf -- Run testnet with mainnet on-chain params diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs index e0a55d7eb39..e324715ce7f 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs @@ -65,7 +65,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H -- TODO: Use cardanoTestnet in hprop_shutdown hprop_shutdown :: Property hprop_shutdown = integrationRetryWorkspace 2 "shutdown" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf <- mkConf tempAbsBasePath' + let conf = mkConfig tempAbsBasePath' let tempBaseAbsPath' = makeTmpBaseAbsPath $ tempAbsPath conf tempAbsPath' = unTmpAbsPath $ tempAbsPath conf logDir' = makeLogDir $ tempAbsPath conf @@ -202,7 +202,7 @@ hprop_shutdownOnSlotSynced :: Property hprop_shutdownOnSlotSynced = integrationRetryWorkspace 2 "shutdown-on-slot-synced" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net -- TODO: Move yaml filepath specification into individual node options - conf <- mkConf tempAbsBasePath' + let conf = mkConfig tempAbsBasePath' let maxSlot = 150 epochLength = 300 @@ -254,7 +254,7 @@ hprop_shutdownOnSigint :: Property hprop_shutdownOnSigint = integrationRetryWorkspace 2 "shutdown-on-sigint" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net -- TODO: Move yaml filepath specification into individual node options - conf <- mkConf tempAbsBasePath' + let conf = mkConfig tempAbsBasePath' let creationOptions = def { creationGenesisOptions = def { genesisEpochLength = 300 } diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/P2PTopology.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/P2PTopology.hs index 4771145742a..1ab2f047387 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/P2PTopology.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/P2PTopology.hs @@ -8,7 +8,7 @@ module Cardano.Testnet.Test.P2PTopology import qualified Cardano.Node.Configuration.TopologyP2P as P2P import Cardano.Testnet (TestnetCreationOptions (..), cardanoTestnet, createTestnetEnv, - mkConf) + mkConfig) import Cardano.Testnet.Test.Utils (nodesProduceBlocks) import Prelude @@ -34,7 +34,7 @@ hprop_p2p_topology = integrationRetryWorkspace 2 "p2p-topology" $ \tmpDir -> H.r someTopologyFile = tmpDir "node-data" "node1" "topology.json" -- Generate the sandbox - conf <- mkConf tmpDir + let conf = mkConfig tmpDir liftToIntegration $ createTestnetEnv creationOptions conf -- Check that the topology is indeed P2P diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Eval.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Eval.hs index c8b3c69ee8a..6dc2c23fcff 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Eval.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Eval.hs @@ -56,7 +56,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H -- redeemer, and no errors. hprop_rpc_eval_tx :: Property hprop_rpc_eval_tx = integrationRetryWorkspace 2 "rpc-eval-tx" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf{tempAbsPath} <- mkConf tempAbsBasePath' + let conf@Conf{tempAbsPath} = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath work <- H.createDirectoryIfMissing $ tempAbsPath' "work" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Query.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Query.hs index ccf328fc442..b038ca740fd 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Query.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Query.hs @@ -54,7 +54,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H -- @TASTY_PATTERN='/RPC Query Protocol Params/' cabal test cardano-testnet-test@ hprop_rpc_query_pparams :: Property hprop_rpc_query_pparams = integrationRetryWorkspace 2 "rpc-query-pparams" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf@Conf{tempAbsPath} <- mkConf tempAbsBasePath' + let conf@Conf{tempAbsPath} = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath let era = Exp.ConwayEra diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/SearchUtxos.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/SearchUtxos.hs index 949999a6eac..3995289568f 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/SearchUtxos.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/SearchUtxos.hs @@ -57,7 +57,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H -- @TASTY_PATTERN='/RPC SearchUtxos/' cabal test cardano-testnet-test@ hprop_rpc_search_utxos :: Property hprop_rpc_search_utxos = integrationRetryWorkspace 2 "rpc-search-utxos" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf <- mkConf tempAbsBasePath' + let conf = mkConfig tempAbsBasePath' let era = Exp.ConwayEra sbe = convert era creationOptions = def{creationEra = AnyShelleyBasedEra sbe} diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Transaction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Transaction.hs index bd2f27f0fad..9c1cf1780f0 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Transaction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Rpc/Transaction.hs @@ -46,7 +46,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H -- @TASTY_PATTERN='/RPC Transaction Submit/' cabal test cardano-testnet-test@ hprop_rpc_transaction :: Property hprop_rpc_transaction = integrationRetryWorkspace 2 "rpc-tx" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do - conf <- mkConf tempAbsBasePath' + let conf = mkConfig tempAbsBasePath' let era = Exp.ConwayEra sbe = convert era creationOptions = def{creationEra = AnyShelleyBasedEra sbe} diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/RunTestnet.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/RunTestnet.hs index e82a23e4c85..44aed24931a 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/RunTestnet.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/RunTestnet.hs @@ -6,7 +6,7 @@ module Cardano.Testnet.Test.RunTestnet ( hprop_run_testnet ) where -import Cardano.Testnet (TestnetCreationOptions (..), createAndRunTestnet, mkConf) +import Cardano.Testnet (TestnetCreationOptions (..), createAndRunTestnet, mkConfig) import Cardano.Testnet.Test.Utils (nodesProduceBlocks) import Prelude @@ -28,7 +28,7 @@ hprop_run_testnet = integrationRetryWorkspace 2 "run-testnet" $ \tmpDir -> H.run { creationGenesisOptions = def { genesisEpochLength = 200 } } - conf <- mkConf tmpDir + let conf = mkConfig tmpDir runtime <- createAndRunTestnet creationOptions def conf nodesProduceBlocks tmpDir runtime diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SanityCheck.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SanityCheck.hs index 262b9d1bb51..8b268fea423 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SanityCheck.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SanityCheck.hs @@ -49,7 +49,7 @@ newtype AdditionalCatcher hprop_ledger_events_sanity_check :: Property hprop_ledger_events_sanity_check = integrationRetryWorkspace 2 "ledger-events-sanity-check" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do -- Start a local test net - conf <- mkConf tempAbsBasePath' + let conf = mkConfig tempAbsBasePath' let creationOptions = def { creationGenesisOptions = def diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Transaction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Transaction.hs index 2e84dcba5dc..dec335726de 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Transaction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Transaction.hs @@ -55,7 +55,7 @@ import qualified Hedgehog.Extras.Test.TestWatchdog as H hprop_transaction :: Property hprop_transaction = integrationRetryWorkspace 2 "submit-api-transaction" $ \tempAbsBasePath' -> H.runWithDefaultWatchdog_ $ do H.note_ SYS.os - conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' + let conf@Conf { tempAbsPath } = mkConfig tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath sbe = ShelleyBasedEraConway eraString = eraToString sbe diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/UpdateTimeStamps.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/UpdateTimeStamps.hs index a406125f9e7..1c77fbb3af3 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/UpdateTimeStamps.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/UpdateTimeStamps.hs @@ -32,7 +32,7 @@ hprop_update_time_stamps = integrationRetryWorkspace 2 "update-time-stamps" $ \t let creationOptions = def { creationGenesisOptions = def { genesisEpochLength = 200 } } -- Generate the sandbox - conf <- mkConf tmpDir + let conf = mkConfig tmpDir liftToIntegration $ createTestnetEnv creationOptions -- Do not add hashes to the main config file, so that genesis files From 757052bf1150f4770249ff58a25585c211cd9d71 Mon Sep 17 00:00:00 2001 From: Pablo Lamela Date: Wed, 5 Aug 2026 00:15:41 +0200 Subject: [PATCH 2/2] Clean up changelog entry --- ...4_213638_palas_cleanup_conf_constructor_naming.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cardano-testnet/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml b/cardano-testnet/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml index 1993471cf22..78a8e988d54 100644 --- a/cardano-testnet/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml +++ b/cardano-testnet/.changes/20260804_213638_palas_cleanup_conf_constructor_naming.yml @@ -2,11 +2,6 @@ pr: 6637 kind: - breaking description: | - - Cleaned up the naming of the `Conf` constructors in `Testnet.Start.Types`: - - Removed `mkConf`. Its only difference with `mkConfig` was noting the path in the test log, - which was redundant: every call site passes a workspace path that hedgehog-extras' - `workspace` already annotates on creation. Test code now uses the pure `mkConfig` - directly, which is now exported (and re-exported from `Cardano.Testnet` in place of - `mkConf`). - - Renamed `mkConfigAbs` to `mkConfigAbsolute`, and documented that, besides making the - path absolute, it also creates the directory if it doesn't exist yet. + - Cleaned up the naming of the `*Conf*` constructors in `Testnet.Start.Types`: + - Removed `mkConf`. Its only difference with `mkConfig` was noting the path in the test log, which was redundant. Test code now uses the pure `mkConfig` directly, now exported in place of `mkConf`. + - Renamed `mkConfigAbs` to `mkConfigAbsolute`, and documented that, besides making the path absolute, it also creates the directory if it doesn't exist yet.