Skip to content

Commit d401429

Browse files
committed
ThreadNet: minimise syntactic differences
1 parent f319440 commit d401429

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/AllegraMary.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ tests :: TestTree
7171
tests =
7272
testGroup
7373
"AllegraMary ThreadNet"
74-
[ askTestEnv $ adjustTestEnv $ testProperty "simple convergence" prop_simple_allegraMary_convergence
74+
[ askTestEnv $
75+
adjustTestEnv $
76+
testProperty "simple convergence" prop_simple_allegraMary_convergence
7577
]
7678
where
7779
adjustTestEnv :: TestTree -> TestEnv -> TestTree

ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/MaryAlonzo.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,13 @@ tests :: TestTree
7777
tests =
7878
testGroup
7979
"MaryAlonzo ThreadNet"
80-
[ let name = "simple convergence"
81-
in askTestEnv $
82-
adjustTestMode $
83-
testProperty name prop_simple_allegraAlonzo_convergence
80+
[ askTestEnv $
81+
adjustTestEnv $
82+
testProperty "simple convergence" prop_simple_allegraAlonzo_convergence
8483
]
8584
where
86-
adjustTestMode :: TestTree -> TestEnv -> TestTree
87-
adjustTestMode tree = \case
85+
adjustTestEnv :: TestTree -> TestEnv -> TestTree
86+
adjustTestEnv tree = \case
8887
Nightly -> tree
8988
_ -> adjustQuickCheckTests (`div` 10) tree
9089

ouroboros-consensus-cardano/test/cardano-test/Test/ThreadNet/ShelleyAllegra.hs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ import Test.Util.TestEnv
6969

7070
tests :: TestTree
7171
tests =
72-
testGroup "ShelleyAllegra ThreadNet" $
73-
[ let name = "simple convergence"
74-
in askTestEnv $ adjustTestMode $ testProperty name $ \setup ->
75-
prop_simple_shelleyAllegra_convergence setup
72+
testGroup
73+
"ShelleyAllegra ThreadNet"
74+
[ askTestEnv $
75+
adjustTestEnv $
76+
testProperty "simple convergence" prop_simple_shelleyAllegra_convergence
7677
]
7778
where
78-
adjustTestMode :: TestTree -> TestEnv -> TestTree
79-
adjustTestMode tree = \case
79+
adjustTestEnv :: TestTree -> TestEnv -> TestTree
80+
adjustTestEnv tree = \case
8081
Nightly -> tree
8182
_ -> adjustQuickCheckTests (`div` 10) tree
8283

@@ -189,7 +190,7 @@ prop_simple_shelleyAllegra_convergence
189190
(SL.ProtVer majorVersion1 0)
190191
(SL.ProtVer majorVersion2 0)
191192
( L.mkTransitionConfig L.NoGenesis $
192-
L.mkShelleyTransitionConfig genesisShelley
193+
L.mkShelleyTransitionConfig shelleyGenesis
193194
)
194195
hardForkTrigger
195196
in TestNodeInitialization
@@ -227,8 +228,8 @@ prop_simple_shelleyAllegra_convergence
227228
maxLovelaceSupply =
228229
fromIntegral (length coreNodes) * Shelley.initialLovelacePerCoreNode
229230

230-
genesisShelley :: ShelleyGenesis
231-
genesisShelley =
231+
shelleyGenesis :: ShelleyGenesis
232+
shelleyGenesis =
232233
Shelley.mkGenesisConfig
233234
(SL.ProtVer majorVersion1 0)
234235
setupK
@@ -242,7 +243,7 @@ prop_simple_shelleyAllegra_convergence
242243
-- the Shelley ledger is designed to use a fixed epoch size, so this test
243244
-- does not randomize it
244245
epochSize :: EpochSize
245-
epochSize = sgEpochLength genesisShelley
246+
epochSize = sgEpochLength shelleyGenesis
246247

247248
firstEraSize :: EraSize
248249
firstEraSize = EraSize numFirstEraEpochs
@@ -282,7 +283,7 @@ prop_simple_shelleyAllegra_convergence
282283
secondEraOverlaySlots
283284
numSlots
284285
(NumSlots numFirstEraSlots)
285-
(sgProtocolParams genesisShelley ^. SL.ppDG)
286+
(sgProtocolParams shelleyGenesis ^. SL.ppDG)
286287
epochSize
287288

288289
numFirstEraSlots :: Word64

0 commit comments

Comments
 (0)