Skip to content

Commit

Permalink
Merge pull request #5954 from IntersectMBO/smelc/small-improvements-c…
Browse files Browse the repository at this point in the history
…ardano-testnet

cardano-testnet: small improvements
  • Loading branch information
smelc authored Aug 21, 2024
2 parents 733cd8b + 3a5ef35 commit 6aa375c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cardano-testnet/src/Testnet/Components/Configuration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Testnet.Components.Configuration
, getByronGenesisHash
, getShelleyGenesisHash

, NumPools
, NumPools(..)
, numPools
, NumDReps
, numDReps
Expand Down
10 changes: 7 additions & 3 deletions cardano-testnet/src/Testnet/Process/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,11 @@ data ExecutableError
= CannotDecodePlanJSON FilePath String
| RetrievePlanJsonFailure IOException
| ReadFileFailure IOException
| MissingExecutable FilePath String
| ExecutableMissingInComponent FilePath String
-- ^ Component with key @component-name@ is found, but it is missing
-- the @bin-file@ key.
| ExecutableNotFoundInPlan String
-- ^ Component with key @component-name@ cannot be found
deriving Show


Expand All @@ -333,8 +337,8 @@ binDist pkg = do
Right plan -> case List.filter matching (plan & installPlan) of
(component:_) -> case component & binFile of
Just bin -> return $ addExeSuffix (Text.unpack bin)
Nothing -> left $ MissingExecutable pJsonFp $ "missing bin-file in: " <> show component
[] -> error $ "Cannot find exe:" <> pkg <> " in plan"
Nothing -> left $ ExecutableMissingInComponent pJsonFp $ "missing \"bin-file\" key in plan component: " <> show component
[] -> left $ ExecutableNotFoundInPlan $ "Cannot find \"component-name\" key with value \"exe:" <> pkg <> "\""
Left message -> left $ CannotDecodePlanJSON pJsonFp $ "Cannot decode plan: " <> message
where matching :: Component -> Bool
matching component = case componentName component of
Expand Down
3 changes: 2 additions & 1 deletion cardano-testnet/src/Testnet/Property/Assert.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import Data.Type.Equality
import Data.Word (Word8)
import GHC.Stack as GHC

import Testnet.Components.Configuration (NumPools(..), numPools)
import Testnet.Process.Run
import Testnet.Start.Types

Expand Down Expand Up @@ -87,7 +88,7 @@ assertExpectedSposInLedgerState
-> ExecConfig
-> m ()
assertExpectedSposInLedgerState output tNetOptions execConfig = withFrozenCallStack $ do
let numExpectedPools = length $ cardanoNodes tNetOptions
let NumPools numExpectedPools = numPools tNetOptions

void $ execCli' execConfig
[ "query", "stake-pools"
Expand Down

0 comments on commit 6aa375c

Please sign in to comment.