diff --git a/leios-trace-verifier/hs-src/app/linear/Main.hs b/leios-trace-verifier/hs-src/app/linear/Main.hs index b3af08a8b..ed9f87a3f 100644 --- a/leios-trace-verifier/hs-src/app/linear/Main.hs +++ b/leios-trace-verifier/hs-src/app/linear/Main.hs @@ -23,7 +23,7 @@ main = do Command{..} <- execParser commandParser - -- Prameters from topology + -- Parameters from topology (top :: Topology COORD2D) <- decodeFileThrow topologyFile let nrNodes = toInteger $ Prelude.length (elems $ nodes top) let nodeNames = Prelude.map unNodeName (keys $ nodes top) @@ -37,9 +37,10 @@ main = let ldiff = toInteger (linearDiffuseStageLengthSlots config) let validityCheckTime = 3 -- TODO: read from config result <- - verifyTrace nrNodes idSut stakeDistribution lhdr lvote ldiff validityCheckTime - . decodeJSONL - <$> BSL.readFile logFile + pure ($ startingSlot) + <*> verifyTraceFromSlot nrNodes idSut stakeDistribution lhdr lvote ldiff validityCheckTime + . decodeJSONL + <$> BSL.readFile logFile hPutStrLn stderr $ "Applying " <> show (fst result) <> " actions" unless (fst (snd result) == "ok") $ do @@ -51,6 +52,7 @@ data Command = Command { logFile :: FilePath , configFile :: FilePath , topologyFile :: FilePath + , startingSlot :: Integer , idSut :: Integer } deriving (Eq, Ord, Read, Show) @@ -67,4 +69,5 @@ commandParser = <$> strOption (long "trace-file" <> help "Leios simulation trace log file") <*> strOption (long "config-file" <> help "Leios configuration file") <*> strOption (long "topology-file" <> help "Leios topology file") + <*> option auto (long "starting-slot" <> value 0 <> help "Starting slot of trace-file") <*> option auto (long "idSut" <> help "Id of system under test (SUT)")