{-# 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.Imp.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 (LedgerSpec, ShelleyEraImp)
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 t. ImpSpec t => SpecWith (ImpInit t) -> Spec
withImpInit @(LedgerSpec era) forall a b. (a -> b) -> a -> b
$ do
    forall era.
ShelleyEraImp era =>
SpecWith (ImpInit (LedgerSpec era))
Ledger.spec
    forall era.
ShelleyEraImp era =>
SpecWith (ImpInit (LedgerSpec era))
Epoch.spec
    forall era.
(ShelleyEraImp era, Arbitrary (TxAuxData era),
 InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era) =>
SpecWith (ImpInit (LedgerSpec era))
Utxow.spec
    forall era.
(ShelleyEraImp era,
 InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era) =>
SpecWith (ImpInit (LedgerSpec era))
Utxo.spec
  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