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

module Test.Cardano.Ledger.Shelley.Imp (spec) where

import Cardano.Ledger.Core
import Cardano.Ledger.Shelley.Rules (ShelleyUtxoPredFailure, ShelleyUtxowPredFailure)
import Test.Cardano.Ledger.Common
import qualified Test.Cardano.Ledger.Shelley.Imp.EpochSpec as Epoch
import qualified Test.Cardano.Ledger.Shelley.Imp.LedgerSpec as Ledger
import qualified Test.Cardano.Ledger.Shelley.Imp.UtxoSpec as Utxo
import qualified Test.Cardano.Ledger.Shelley.Imp.UtxowSpec as Utxow
import Test.Cardano.Ledger.Shelley.ImpTest (ShelleyEraImp, withImpState)
import qualified Test.Cardano.Ledger.Shelley.UnitTests.IncrementalStakeTest as Incremental

spec ::
  forall era.
  ( Arbitrary (TxAuxData era)
  , ShelleyEraImp era
  , InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era
  , InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era
  ) =>
  Spec
spec :: forall era.
(Arbitrary (TxAuxData era), ShelleyEraImp era,
 InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era,
 InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era) =>
Spec
spec = do
  forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"ShelleyImpSpec" forall a b. (a -> b) -> a -> b
$ forall era.
ShelleyEraImp era =>
SpecWith (ImpTestState era) -> Spec
withImpState @era forall a b. (a -> b) -> a -> b
$ do
    forall era. ShelleyEraImp era => SpecWith (ImpTestState era)
Ledger.spec @era
    forall era. ShelleyEraImp era => SpecWith (ImpTestState era)
Epoch.spec @era
    forall era.
(ShelleyEraImp era, Arbitrary (TxAuxData era),
 InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era) =>
SpecWith (ImpTestState era)
Utxow.spec @era
    forall era.
(ShelleyEraImp era,
 InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era) =>
SpecWith (ImpTestState era)
Utxo.spec @era
  forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"ShelleyPureTests" forall a b. (a -> b) -> a -> b
$ do
    forall era. EraTxOut era => Spec
Incremental.spec @era