Skip to content

Commit

Permalink
consensus-cardano-test: add MaryAlonzo hard fork ThreadNet test
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrisby committed May 14, 2021
1 parent 4a8bf47 commit 2fb061b
Show file tree
Hide file tree
Showing 6 changed files with 422 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ library
Test.ThreadNet.Infra.TwoEras

Test.ThreadNet.TxGen.Allegra
Test.ThreadNet.TxGen.Alonzo
Test.ThreadNet.TxGen.Cardano
Test.ThreadNet.TxGen.Mary

Expand All @@ -36,10 +37,6 @@ library
, cardano-binary
, cardano-crypto-class
, cardano-crypto-wrapper
, cardano-ledger-alonzo-test
, cardano-ledger-byron
, cardano-ledger-byron-test
, cardano-ledger-core
, cardano-prelude
, cardano-slotting
, cborg
Expand All @@ -53,6 +50,11 @@ library
, tasty-quickcheck
, time

, cardano-ledger-alonzo
, cardano-ledger-alonzo-test
, cardano-ledger-byron
, cardano-ledger-byron-test
, cardano-ledger-core
, shelley-spec-ledger
, shelley-spec-ledger-test

Expand Down Expand Up @@ -84,17 +86,16 @@ test-suite test
Test.Consensus.Cardano.ByronCompatibility
Test.Consensus.Cardano.Golden
Test.Consensus.Cardano.Serialisation
Test.ThreadNet.AllegraMary
Test.ThreadNet.Cardano
Test.ThreadNet.MaryAlonzo
Test.ThreadNet.ShelleyAllegra
Test.ThreadNet.AllegraMary

build-depends: base
, bytestring
, cardano-binary
, cardano-crypto-class
, cardano-crypto-wrapper
, cardano-ledger-byron
, cardano-ledger-byron-test
, cardano-slotting
, cborg
, containers
Expand All @@ -106,6 +107,9 @@ test-suite test
, tasty-quickcheck
, time

, cardano-ledger-alonzo
, cardano-ledger-byron
, cardano-ledger-byron-test
, shelley-spec-ledger
, shelley-spec-ledger-test

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Test.ThreadNet.TxGen.Alonzo () where

import Ouroboros.Consensus.Shelley.Eras
import Ouroboros.Consensus.Shelley.Ledger

import Test.ThreadNet.TxGen (TxGen (..))

-- | Dummy generator until CAD-2119 is done, i.e., the transaction generator in
-- the ledger has been generalised over the eras.
instance TxGen (ShelleyBlock (AlonzoEra c)) where

type TxGenExtra (ShelleyBlock (AlonzoEra c)) = ()

testGenTxs _ _ _ _ _ _ = pure []
4 changes: 3 additions & 1 deletion ouroboros-consensus-cardano-test/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import qualified Test.Consensus.Cardano.Golden (tests)
import qualified Test.Consensus.Cardano.Serialisation (tests)
import qualified Test.ThreadNet.AllegraMary (tests)
import qualified Test.ThreadNet.Cardano (tests)
import qualified Test.ThreadNet.MaryAlonzo (tests)
import qualified Test.ThreadNet.ShelleyAllegra (tests)

main :: IO ()
Expand All @@ -21,7 +22,8 @@ tests =
[ Test.Consensus.Cardano.ByronCompatibility.tests
, Test.Consensus.Cardano.Golden.tests
, Test.Consensus.Cardano.Serialisation.tests
, Test.ThreadNet.AllegraMary.tests
, Test.ThreadNet.Cardano.tests
, Test.ThreadNet.MaryAlonzo.tests
, Test.ThreadNet.ShelleyAllegra.tests
, Test.ThreadNet.AllegraMary.tests
]
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ prop_simple_allegraMary_convergence TestSetup
tniCrucialTxs =
if not setupHardFork then [] else
fmap GenTxShelley1 $
Shelley.mkAllegraSetDecentralizationParamTxs
Shelley.mkMASetDecentralizationParamTxs
coreNodes
(SL.ProtVer majorVersion2 0)
(SlotNo $ unNumSlots numSlots) -- never expire
Expand Down
Loading

0 comments on commit 2fb061b

Please sign in to comment.