Skip to content

Commit d7b60ca

Browse files
committed
Fix build issues
1 parent a13dd5c commit d7b60ca

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cardano-testnet/src/Testnet/Runtime.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import Data.Algorithm.Diff
3737
import Data.Algorithm.DiffOutput
3838
import Data.Bifunctor (first)
3939
import qualified Data.ByteString.Lazy.Char8 as BSC
40-
import Data.List (isInfixOf)
40+
import Data.List (isInfixOf, uncons)
4141
import qualified Data.List as List
4242
import GHC.Stack
4343
import 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)

cardano-testnet/src/Testnet/Start/Cardano.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import qualified Data.ByteString.Lazy as LBS
5050
import Data.Default.Class (def)
5151
import Data.Either
5252
import Data.Functor
53+
import Data.List (uncons)
5354
import Data.MonoTraversable (Element, MonoFunctor, omap)
5455
import qualified Data.Text as Text
5556
import 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

0 commit comments

Comments
 (0)