{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}

module Test.Cardano.Ledger.Alonzo.Imp where

import Cardano.Ledger.Alonzo.Core
import Cardano.Ledger.Alonzo.Rules (
  AlonzoUtxoPredFailure,
  AlonzoUtxosPredFailure,
  AlonzoUtxowPredFailure,
 )
import Cardano.Ledger.Shelley.Rules (ShelleyUtxoPredFailure, ShelleyUtxowPredFailure)
import qualified Test.Cardano.Ledger.Alonzo.Imp.UtxoSpec as Utxo
import qualified Test.Cardano.Ledger.Alonzo.Imp.UtxosSpec as Utxos
import qualified Test.Cardano.Ledger.Alonzo.Imp.UtxowSpec as Utxow
import Test.Cardano.Ledger.Alonzo.ImpTest (AlonzoEraImp, withImpState)
import Test.Cardano.Ledger.Common
import qualified Test.Cardano.Ledger.Mary.Imp as MaryImp

spec ::
  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
spec :: 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
spec = do
  forall era.
(Arbitrary (TxAuxData era), MaryEraImp era, AllegraEraScript era,
 InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era,
 InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era) =>
Spec
MaryImp.spec @era
  forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"AlonzoImpSpec" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall era.
ShelleyEraImp era =>
SpecWith (ImpTestState era) -> Spec
withImpState @era forall a b. (a -> b) -> a -> b
$ do
    forall era.
(AlonzoEraImp era,
 InjectRuleFailure "LEDGER" AlonzoUtxoPredFailure era) =>
SpecWith (ImpTestState era)
Utxo.spec @era
    forall era.
(AlonzoEraImp era,
 InjectRuleFailure "LEDGER" AlonzoUtxosPredFailure era) =>
SpecWith (ImpTestState era)
Utxos.spec @era
    forall era.
(AlonzoEraImp era,
 InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era,
 InjectRuleFailure "LEDGER" AlonzoUtxosPredFailure era,
 InjectRuleFailure "LEDGER" AlonzoUtxowPredFailure era) =>
SpecWith (ImpTestState era)
Utxow.spec @era