Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions leios-trace-verifier/hs-src/app/linear/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -51,6 +52,7 @@ data Command = Command
{ logFile :: FilePath
, configFile :: FilePath
, topologyFile :: FilePath
, startingSlot :: Integer
, idSut :: Integer
}
deriving (Eq, Ord, Read, Show)
Expand All @@ -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)")