From 1670b628cc7accea1c7ecd9359a7dccb6bd50a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 29 Nov 2024 21:40:16 +0100 Subject: Represent root network as an internal variable --- src/Run.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Run.hs') diff --git a/src/Run.hs b/src/Run.hs index fd02af3..54fdba6 100644 --- a/src/Run.hs +++ b/src/Run.hs @@ -59,8 +59,7 @@ runTest out opts test variables = do , teGDB = fst <$> mgdb } tstate = TestState - { tsNetwork = error "network not initialized" - , tsVars = builtins + { tsVars = builtins , tsNodePacketLoss = M.empty , tsDisconnectedUp = S.empty , tsDisconnectedBridge = S.empty @@ -184,7 +183,8 @@ withInternet inner = do testDir <- asks $ optTestDir . teOptions . fst inet <- newInternet testDir res <- withNetwork (inetRoot inet) $ \net -> do - local (fmap $ \s -> s { tsNetwork = net }) $ inner net + withTypedVar rootNetworkVar net $ do + inner net delInternet inet return res -- cgit v1.2.3