File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
cardano-testnet/src/Testnet Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ import Data.Algorithm.Diff
3737import Data.Algorithm.DiffOutput
3838import Data.Bifunctor (first )
3939import qualified Data.ByteString.Lazy.Char8 as BSC
40- import Data.List (isInfixOf )
40+ import Data.List (isInfixOf , uncons )
4141import qualified Data.List as List
4242import GHC.Stack
4343import qualified GHC.Stack as GHC
@@ -297,8 +297,11 @@ startLedgerNewEpochStateLogging testnetRuntime tmpWorkspace = withFrozenCallStac
297297 liftIOAnnotated $ IO. doesFileExist logFile >>= \ case
298298 True -> return ()
299299 False -> liftIO $ appendFile logFile " "
300-
301- let socketPath = H. sprocketSystemName $ head (testnetSprockets testnetRuntime)
300+
301+ let socketPath = case uncons (testnetSprockets testnetRuntime) of
302+ Just (sprocket, _) -> H. sprocketSystemName sprocket
303+ Nothing -> throwString " No testnet sprocket available"
304+
302305 let act = runExceptT $
303306 foldEpochState
304307 (configurationFile testnetRuntime)
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ import qualified Data.ByteString.Lazy as LBS
5050import Data.Default.Class (def )
5151import Data.Either
5252import Data.Functor
53+ import Data.List (uncons )
5354import Data.MonoTraversable (Element , MonoFunctor , omap )
5455import qualified Data.Text as Text
5556import Data.Time (diffUTCTime )
@@ -400,7 +401,9 @@ cardanoTestnet
400401
401402 let tempBaseAbsPath = makeTmpBaseAbsPath $ TmpAbsolutePath tmpAbsPath
402403
403- let node1sprocket = head $ testnetSprockets runtime
404+ node1sprocket <- case uncons $ testnetSprockets runtime of
405+ Just (sprocket, _) -> pure sprocket
406+ Nothing -> throwString " No testnet sprocket available"
404407 execConfig <- mkExecConfig tempBaseAbsPath node1sprocket testnetMagic
405408
406409 forM_ wallets $ \ wallet -> do
You can’t perform that action at this time.
0 commit comments