{-# LANGUAGE TypeApplications #-}

module Main where

import Cardano.Ledger.Conway (Conway)
import qualified Test.Cardano.Ledger.Alonzo.Binary.CostModelsSpec as CostModelsSpec
import qualified Test.Cardano.Ledger.Alonzo.Binary.TxWitsSpec as TxWitsSpec
import Test.Cardano.Ledger.Common
import qualified Test.Cardano.Ledger.Conway.Binary.CddlSpec as Cddl
import qualified Test.Cardano.Ledger.Conway.Binary.Regression as Regression
import qualified Test.Cardano.Ledger.Conway.BinarySpec as Binary
import qualified Test.Cardano.Ledger.Conway.CommitteeRatifySpec as CommitteeRatify
import qualified Test.Cardano.Ledger.Conway.DRepRatifySpec as DRepRatify
import qualified Test.Cardano.Ledger.Conway.GenesisSpec as Genesis
import qualified Test.Cardano.Ledger.Conway.GoldenTranslation as Golden
import qualified Test.Cardano.Ledger.Conway.GovActionReorderSpec as GovActionReorder
import qualified Test.Cardano.Ledger.Conway.Imp as Imp
import Test.Cardano.Ledger.Conway.Plutus.PlutusSpec as PlutusSpec
import qualified Test.Cardano.Ledger.Conway.Proposals as Proposals
import qualified Test.Cardano.Ledger.Conway.SPORatifySpec as SPORatifySpec
import qualified Test.Cardano.Ledger.Conway.Spec as Spec
import qualified Test.Cardano.Ledger.Conway.TxInfoSpec as TxInfo
import Test.Cardano.Ledger.Core.JSON (roundTripJsonEraSpec)

main :: IO ()
IO ()
main =
  Spec -> IO ()
ledgerTestMain forall a b. (a -> b) -> a -> b
$
    forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"Conway" forall a b. (a -> b) -> a -> b
$ do
      Spec
Golden.spec
      Spec
Spec.spec
      Spec
Proposals.spec
      Spec
Binary.spec
      Spec
Cddl.spec
      Spec
DRepRatify.spec
      Spec
CommitteeRatify.spec
      Spec
SPORatifySpec.spec
      Spec
Genesis.spec
      Spec
GovActionReorder.spec
      forall era.
(HasCallStack, EraPParams era, Arbitrary (PParams era)) =>
Spec
roundTripJsonEraSpec @Conway
      forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"Imp" forall a b. (a -> b) -> a -> b
$
        forall era.
(Arbitrary (TxAuxData era), ConwayEraImp era, EraSegWits era,
 InjectRuleFailure "LEDGER" ConwayGovPredFailure era,
 InjectRuleFailure "LEDGER" ConwayCertsPredFailure era,
 Inject (BabbageContextError era) (ContextError era),
 Inject (ConwayContextError era) (ContextError era),
 InjectRuleFailure "LEDGER" BabbageUtxoPredFailure era,
 InjectRuleFailure "LEDGER" BabbageUtxowPredFailure era,
 InjectRuleFailure "LEDGER" AlonzoUtxoPredFailure era,
 InjectRuleFailure "LEDGER" AlonzoUtxosPredFailure era,
 InjectRuleFailure "LEDGER" AlonzoUtxowPredFailure era,
 InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era,
 InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era,
 InjectRuleFailure "LEDGER" ConwayDelegPredFailure era,
 InjectRuleFailure "LEDGER" ConwayGovCertPredFailure era,
 InjectRuleFailure "LEDGER" ConwayLedgerPredFailure era,
 InjectRuleFailure "BBODY" ConwayBbodyPredFailure era,
 NFData (Event (EraRule "ENACT" era)),
 ToExpr (Event (EraRule "ENACT" era)),
 Eq (Event (EraRule "ENACT" era)),
 Typeable (Event (EraRule "ENACT" era)),
 InjectRuleEvent "TICK" ConwayEpochEvent era,
 Event (EraRule "EPOCH" era) ~ ConwayEpochEvent era,
 Event (EraRule "NEWEPOCH" era) ~ ConwayNewEpochEvent era,
 Event (EraRule "MEMPOOL" era) ~ ConwayMempoolEvent era,
 Event (EraRule "LEDGERS" era) ~ ShelleyLedgersEvent era,
 Event (EraRule "LEDGER" era) ~ ConwayLedgerEvent era,
 BaseM (EraRule "LEDGERS" era) ~ ShelleyBase,
 Environment (EraRule "LEDGERS" era) ~ ShelleyLedgersEnv era,
 Signal (EraRule "LEDGERS" era) ~ Seq (Tx era),
 STS (EraRule "LEDGERS" era), ApplyTx era,
 Event (EraRule "HARDFORK" era) ~ ConwayHardForkEvent era) =>
Spec
Imp.spec @Conway
      forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"CostModels" forall a b. (a -> b) -> a -> b
$ do
        forall era. (AlonzoEraPParams era, AlonzoEraScript era) => Spec
CostModelsSpec.spec @Conway
      forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"TxWits" forall a b. (a -> b) -> a -> b
$ do
        forall era.
(AlonzoEraScript era, Script era ~ AlonzoScript era,
 NativeScript era ~ Timelock era) =>
Spec
TxWitsSpec.spec @Conway
      forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"Plutus" forall a b. (a -> b) -> a -> b
$ do
        Spec
PlutusSpec.spec
      forall era. (EraTx era, NFData (Tx era)) => Spec
Regression.spec @Conway
      Spec
TxInfo.spec