{-# LANGUAGE TypeApplications #-}

module Main where

import Cardano.Ledger.Alonzo (Alonzo)
import qualified Test.Cardano.Ledger.Alonzo.Binary.CddlSpec as CddlSpec
import qualified Test.Cardano.Ledger.Alonzo.Binary.CostModelsSpec as CostModelsSpec
import qualified Test.Cardano.Ledger.Alonzo.Binary.TxWitsSpec as TxWitsSpec
import qualified Test.Cardano.Ledger.Alonzo.BinarySpec as BinarySpec
import qualified Test.Cardano.Ledger.Alonzo.GoldenTranslation as Golden
import qualified Test.Cardano.Ledger.Alonzo.Imp as Imp
import Test.Cardano.Ledger.Alonzo.ImpTest ()
import Test.Cardano.Ledger.Common
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
"Alonzo" forall a b. (a -> b) -> a -> b
$ do
      Spec
BinarySpec.spec
      Spec
CddlSpec.spec
      forall era.
(HasCallStack, EraPParams era, Arbitrary (PParams era)) =>
Spec
roundTripJsonEraSpec @Alonzo
      Spec
Golden.tests
      forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"Imp" forall a b. (a -> b) -> a -> b
$ do
        forall era.
(Arbitrary (TxAuxData era), AlonzoEraImp era,
 InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era,
 InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era,
 InjectRuleFailure "LEDGER" AlonzoUtxoPredFailure era,
 InjectRuleFailure "LEDGER" AlonzoUtxosPredFailure era,
 InjectRuleFailure "LEDGER" AlonzoUtxowPredFailure era) =>
Spec
Imp.spec @Alonzo
      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 @Alonzo
      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 @Alonzo