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

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

import Cardano.Ledger.Allegra.Scripts
import Cardano.Ledger.Mary.Core
import Cardano.Ledger.Shelley.Rules (ShelleyUtxoPredFailure, ShelleyUtxowPredFailure)
import qualified Test.Cardano.Ledger.Allegra.Imp as AllegraImp
import Test.Cardano.Ledger.Common
import qualified Test.Cardano.Ledger.Mary.Imp.UtxoSpec as Utxo
import Test.Cardano.Ledger.Mary.ImpTest (MaryEraImp)
import Test.Cardano.Ledger.Shelley.ImpTest (withImpState)

spec ::
  forall era.
  ( Arbitrary (TxAuxData era)
  , MaryEraImp era
  , AllegraEraScript era
  , InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era
  , InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era
  ) =>
  Spec
spec :: forall era.
(Arbitrary (TxAuxData era), MaryEraImp era, AllegraEraScript era,
 InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era,
 InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era) =>
Spec
spec = do
  forall era.
(Arbitrary (TxAuxData era), ShelleyEraImp era,
 InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era,
 InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure era) =>
Spec
AllegraImp.spec @era
  forall a. HasCallStack => String -> SpecWith a -> SpecWith a
describe String
"MaryImpSpec" 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.
(HasCallStack, MaryEraImp era, AllegraEraScript era,
 InjectRuleFailure "LEDGER" ShelleyUtxoPredFailure era) =>
SpecWith (ImpTestState era)
Utxo.spec @era