Skip to content

Commit c6a3003

Browse files
committed
Add new option
1 parent 92b7fd1 commit c6a3003

File tree

1 file changed

+7
-4
lines changed
  • leios-trace-verifier/hs-src/app/linear

1 file changed

+7
-4
lines changed

leios-trace-verifier/hs-src/app/linear/Main.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ main =
2323
do
2424
Command{..} <- execParser commandParser
2525

26-
-- Prameters from topology
26+
-- Parameters from topology
2727
(top :: Topology COORD2D) <- decodeFileThrow topologyFile
2828
let nrNodes = toInteger $ Prelude.length (elems $ nodes top)
2929
let nodeNames = Prelude.map unNodeName (keys $ nodes top)
@@ -37,9 +37,10 @@ main =
3737
let ldiff = toInteger (linearDiffuseStageLengthSlots config)
3838
let validityCheckTime = 3 -- TODO: read from config
3939
result <-
40-
verifyTrace nrNodes idSut stakeDistribution lhdr lvote ldiff validityCheckTime
41-
. decodeJSONL
42-
<$> BSL.readFile logFile
40+
pure ($ startingSlot)
41+
<*> verifyTraceFromSlot nrNodes idSut stakeDistribution lhdr lvote ldiff validityCheckTime
42+
. decodeJSONL
43+
<$> BSL.readFile logFile
4344
hPutStrLn stderr $ "Applying " <> show (fst result) <> " actions"
4445
unless (fst (snd result) == "ok") $
4546
do
@@ -51,6 +52,7 @@ data Command = Command
5152
{ logFile :: FilePath
5253
, configFile :: FilePath
5354
, topologyFile :: FilePath
55+
, startingSlot :: Integer
5456
, idSut :: Integer
5557
}
5658
deriving (Eq, Ord, Read, Show)
@@ -67,4 +69,5 @@ commandParser =
6769
<$> strOption (long "trace-file" <> help "Leios simulation trace log file")
6870
<*> strOption (long "config-file" <> help "Leios configuration file")
6971
<*> strOption (long "topology-file" <> help "Leios topology file")
72+
<*> option auto (long "starting-slot" <> value 0 <> help "Starting slot of trace-file")
7073
<*> option auto (long "idSut" <> help "Id of system under test (SUT)")

0 commit comments

Comments
 (0)