Skip to content

Commit 757f338

Browse files
authored
Merge pull request #6118 from IntersectMBO/smelc/remove-unused-cardano-testnet-feature
cardano-testnet: remove possibility to programmatically pass a custom node configuration file (it was unused)
2 parents 97cd975 + d510758 commit 757f338

File tree

6 files changed

+15
-29
lines changed

6 files changed

+15
-29
lines changed

cardano-testnet/src/Parsers/Cardano.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pNumSpoNodes =
7979
<> OA.showDefault
8080
<> OA.value 1)
8181
where
82-
defaultSpoOptions = SpoNodeOptions Nothing []
82+
defaultSpoOptions = SpoNodeOptions []
8383

8484
pGenesisOptions :: Parser GenesisOptions
8585
pGenesisOptions =

cardano-testnet/src/Testnet/Start/Cardano.hs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import Data.Bifunctor (first)
4242
import qualified Data.ByteString.Lazy as LBS
4343
import Data.Either
4444
import Data.Functor
45-
import Data.Maybe
4645
import Data.MonoTraversable (Element, MonoFunctor, omap)
4746
import qualified Data.Text as Text
4847
import Data.Time (diffUTCTime)
@@ -219,13 +218,6 @@ cardanoTestnet
219218

220219
H.note_ OS.os
221220

222-
when (all (isJust . testnetNodeCfgFile) cardanoNodes) $
223-
-- TODO: We need a very simple non-obscure way of generating the files necessary
224-
-- to run a testnet. "create-staked" is not a good way to do this especially because it
225-
-- makes assumptions about where things should go and where genesis template files should be.
226-
-- See all of the ad hoc file creation/renaming/dir creation etc below.
227-
H.failMessage GHC.callStack "Specifying node configuration files per node not supported yet."
228-
229221
-- Write specification files. Those are the same as the genesis files
230222
-- used for launching the nodes, but omitting the content regarding stake, utxos, etc.
231223
-- They are used by benchmarking: as templates to CLI commands,

cardano-testnet/src/Testnet/Start/Types.hs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ module Testnet.Start.Types
1919
, eraToString
2020

2121
, TestnetNodeOptions(..)
22-
, testnetNodeCfgFile
2322
, testnetNodeExtraCliArgs
2423
, isSpoNodeOptions
2524
, isRelayNodeOptions
@@ -128,8 +127,8 @@ instance Default GenesisOptions where
128127

129128
-- | Specify a SPO (Shelley era onwards only) or a Relay node
130129
data TestnetNodeOptions
131-
= SpoNodeOptions (Maybe NodeConfigurationYaml) [String]
132-
| RelayNodeOptions (Maybe NodeConfigurationYaml) [String]
130+
= SpoNodeOptions [String]
131+
| RelayNodeOptions [String]
133132
-- ^ These arguments will be appended to the default set of CLI options when
134133
-- starting the node.
135134
deriving (Eq, Show)
@@ -142,13 +141,8 @@ data UserNodeConfig =
142141

143142
-- | Get extra CLI arguments passed to the node executable
144143
testnetNodeExtraCliArgs :: TestnetNodeOptions -> [String]
145-
testnetNodeExtraCliArgs (SpoNodeOptions _ args) = args
146-
testnetNodeExtraCliArgs (RelayNodeOptions _ args) = args
147-
148-
-- | Get node-specific configuration file path
149-
testnetNodeCfgFile :: TestnetNodeOptions -> Maybe NodeConfigurationYaml
150-
testnetNodeCfgFile (SpoNodeOptions mFp _) = mFp
151-
testnetNodeCfgFile (RelayNodeOptions mFp _) = mFp
144+
testnetNodeExtraCliArgs (SpoNodeOptions args) = args
145+
testnetNodeExtraCliArgs (RelayNodeOptions args) = args
152146

153147
isSpoNodeOptions :: TestnetNodeOptions -> Bool
154148
isSpoNodeOptions SpoNodeOptions{} = True
@@ -160,9 +154,9 @@ isRelayNodeOptions RelayNodeOptions{} = True
160154

161155
cardanoDefaultTestnetNodeOptions :: [TestnetNodeOptions]
162156
cardanoDefaultTestnetNodeOptions =
163-
[ SpoNodeOptions Nothing []
164-
, RelayNodeOptions Nothing []
165-
, RelayNodeOptions Nothing []
157+
[ SpoNodeOptions []
158+
, RelayNodeOptions []
159+
, RelayNodeOptions []
166160
]
167161

168162
data NodeLoggingFormat = NodeLoggingFormatAsJson | NodeLoggingFormatAsText deriving (Eq, Show)

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/LeadershipSchedule.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ hprop_leadershipSchedule = integrationRetryWorkspace 2 "leadership-schedule" $ \
6767
cTestnetOptions = def
6868
{ cardanoNodeEra = asbe
6969
, cardanoNodes =
70-
[ SpoNodeOptions Nothing []
71-
, SpoNodeOptions Nothing []
72-
, SpoNodeOptions Nothing []
70+
[ SpoNodeOptions []
71+
, SpoNodeOptions []
72+
, SpoNodeOptions []
7373
]
7474
}
7575
eraString = eraToString sbe

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Gov/ProposeNewConstitutionSPO.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ hprop_ledger_events_propose_new_constitution_spo = integrationWorkspace "propose
5858
fastTestnetOptions = def
5959
{ cardanoNodeEra = AnyShelleyBasedEra sbe
6060
, cardanoNodes =
61-
[ SpoNodeOptions Nothing []
62-
, SpoNodeOptions Nothing []
63-
, SpoNodeOptions Nothing []
61+
[ SpoNodeOptions []
62+
, SpoNodeOptions []
63+
, SpoNodeOptions []
6464
]
6565
}
6666
shelleyOptions = def { genesisEpochLength = 100 }

cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ hprop_shutdownOnSlotSynced = integrationRetryWorkspace 2 "shutdown-on-slot-synce
198198
slotLen = 0.01
199199
let fastTestnetOptions = def
200200
{ cardanoNodes =
201-
[ SpoNodeOptions Nothing ["--shutdown-on-slot-synced", show maxSlot]
201+
[ SpoNodeOptions ["--shutdown-on-slot-synced", show maxSlot]
202202
]
203203
}
204204
shelleyOptions = def

0 commit comments

Comments
 (0)