Skip to content

Commit

Permalink
Remove ad-hoc debugging trace printing
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed Aug 2, 2024
1 parent 4df27f9 commit 0dcdd24
Showing 1 changed file with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import System.Directory (makeAbsolute)
import System.FilePath ((</>))

import Testnet.Components.Query (checkDRepsNumber, getEpochStateView,
watchEpochStateUpdate, getCurrentEpochNo)
watchEpochStateUpdate)
import qualified Testnet.Defaults as Defaults
import Testnet.Process.Cli.Transaction (TxOutAddress (ReferenceScriptAddress),
retrieveTransactionId, signTx, simpleSpendOutputsOnlyTx, spendOutputsOnlyTx,
Expand Down Expand Up @@ -299,11 +299,7 @@ hprop_cli_queries = integrationWorkspace "cli-queries" $ \tempAbsBasePath' -> H.
do
-- wait for the proposal stage to end
shelleyGenesisVal <- H.evalEitherM $ readJsonFile shelleyGeneisFile
currentEpoch <- getCurrentEpochNo epochStateView
liftIO $ putStrLn $ "\nCurrent epoch is: " ++ show currentEpoch
waitForFuturePParamsToStabilise shelleyGenesisVal
newCurrentEpoch <- getCurrentEpochNo epochStateView
liftIO $ putStrLn $ "New current epoch is: " ++ show newCurrentEpoch
-- to stdout
output <- execCli' execConfig [ eraName, "query", "gov-state" ]
H.diffVsGoldenFile output "test/cardano-testnet-test/files/golden/queries/govStateOut.json"
Expand Down Expand Up @@ -360,21 +356,8 @@ hprop_cli_queries = integrationWorkspace "cli-queries" $ \tempAbsBasePath' -> H.
currentEpochStart = fromNominalDiffTimeMicro slotLength `multNominalDiffTime` (epochLength * unEpochNo currentEpoch) `addUTCTime` systemStart
currentEpochStabilisationTime = timeAfterEpochToWaitTo `addUTCTime` currentEpochStart
timeToWait = currentEpochStabilisationTime `diffUTCTime` currentTime
liftIO $ putStrLn $ "I get the currentEpoch is: " ++ show currentEpoch
liftIO $ putStrLn $ "I get the currentSlot is: " ++ show currentSlot
liftIO $ putStrLn $ "I get the securityParam is: " ++ show securityParam
liftIO $ putStrLn $ "I get the activeSlotsCoeff is: " ++ show activeSlotsCoeff
liftIO $ putStrLn $ "I get I need to wait till slot: " ++ show (unSlotNo currentSlot `div` epochLength * epochLength + fromIntegral slotsAfterEpochToWaitTo)
if timeToWait > 0

Check warning on line 359 in cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Query.hs

View workflow job for this annotation

GitHub Actions / build

Warning in hprop_cli_queries in module Cardano.Testnet.Test.Cli.Query: Use when ▫︎ Found: "if timeToWait > 0 then\n threadDelay $ truncate $ timeToWait * 1_000_000\nelse\n pure ()" ▫︎ Perhaps: "Control.Monad.when (timeToWait > 0)\n $ threadDelay $ truncate $ timeToWait * 1_000_000"
then do threadDelay $ truncate $ timeToWait * 1_000_000
currentTime' <- liftIO getCurrentTime
let chainRuntime' = currentTime' `diffUTCTime` systemStart
currentSlot' = L.SlotNo $ floor $ nominalDiffTimeToSeconds chainRuntime' / nominalDiffTimeToSeconds (fromNominalDiffTimeMicro slotLength)
currentEpoch' = L.EpochNo $ unSlotNo currentSlot' `div` epochLength
liftIO $ putStrLn $ "Now I get the currentEpoch is: " ++ show currentEpoch'
liftIO $ putStrLn $ "Now I get the currentSlot is: " ++ show currentSlot'
liftIO $ putStrLn $ "Now I get the securityParam is: " ++ show securityParam
liftIO $ putStrLn $ "Now I get the activeSlotsCoeff is: " ++ show activeSlotsCoeff
then threadDelay $ truncate $ timeToWait * 1_000_000
else pure ()

readVerificationKeyFromFile :: (MonadIO m, MonadCatch m, MonadTest m, HasTextEnvelope (VerificationKey keyrole), SerialiseAsBech32 (VerificationKey keyrole))
Expand Down

0 comments on commit 0dcdd24

Please sign in to comment.