{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module Cardano.Ledger.Allegra.Rules.Ledgers () where

import Cardano.Ledger.Allegra.Era (AllegraEra)
import Cardano.Ledger.Allegra.Rules.Ledger ()
import Cardano.Ledger.Core
import Cardano.Ledger.Shelley.Rules (
  ShelleyDelegPredFailure,
  ShelleyDelegsPredFailure,
  ShelleyDelplPredFailure,
  ShelleyLedgerPredFailure,
  ShelleyLedgersPredFailure (..),
  ShelleyPoolPredFailure,
  ShelleyPpupPredFailure,
  ShelleyUtxoPredFailure,
  ShelleyUtxowPredFailure,
 )

type instance EraRuleFailure "LEDGERS" (AllegraEra c) = ShelleyLedgersPredFailure (AllegraEra c)

instance InjectRuleFailure "LEDGERS" ShelleyLedgersPredFailure (AllegraEra c)

instance InjectRuleFailure "LEDGERS" ShelleyLedgerPredFailure (AllegraEra c) where
  injectFailure :: ShelleyLedgerPredFailure (AllegraEra c)
-> EraRuleFailure "LEDGERS" (AllegraEra c)
injectFailure = forall era.
PredicateFailure (EraRule "LEDGER" era)
-> ShelleyLedgersPredFailure era
LedgerFailure

instance InjectRuleFailure "LEDGERS" ShelleyUtxowPredFailure (AllegraEra c) where
  injectFailure :: ShelleyUtxowPredFailure (AllegraEra c)
-> EraRuleFailure "LEDGERS" (AllegraEra c)
injectFailure = forall era.
PredicateFailure (EraRule "LEDGER" era)
-> ShelleyLedgersPredFailure era
LedgerFailure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (rule :: Symbol) (t :: * -> *) era.
InjectRuleFailure rule t era =>
t era -> EraRuleFailure rule era
injectFailure

instance InjectRuleFailure "LEDGERS" ShelleyUtxoPredFailure (AllegraEra c) where
  injectFailure :: ShelleyUtxoPredFailure (AllegraEra c)
-> EraRuleFailure "LEDGERS" (AllegraEra c)
injectFailure = forall era.
PredicateFailure (EraRule "LEDGER" era)
-> ShelleyLedgersPredFailure era
LedgerFailure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (rule :: Symbol) (t :: * -> *) era.
InjectRuleFailure rule t era =>
t era -> EraRuleFailure rule era
injectFailure

instance InjectRuleFailure "LEDGERS" ShelleyPpupPredFailure (AllegraEra c) where
  injectFailure :: ShelleyPpupPredFailure (AllegraEra c)
-> EraRuleFailure "LEDGERS" (AllegraEra c)
injectFailure = forall era.
PredicateFailure (EraRule "LEDGER" era)
-> ShelleyLedgersPredFailure era
LedgerFailure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (rule :: Symbol) (t :: * -> *) era.
InjectRuleFailure rule t era =>
t era -> EraRuleFailure rule era
injectFailure

instance InjectRuleFailure "LEDGERS" ShelleyDelegsPredFailure (AllegraEra c) where
  injectFailure :: ShelleyDelegsPredFailure (AllegraEra c)
-> EraRuleFailure "LEDGERS" (AllegraEra c)
injectFailure = forall era.
PredicateFailure (EraRule "LEDGER" era)
-> ShelleyLedgersPredFailure era
LedgerFailure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (rule :: Symbol) (t :: * -> *) era.
InjectRuleFailure rule t era =>
t era -> EraRuleFailure rule era
injectFailure

instance InjectRuleFailure "LEDGERS" ShelleyDelplPredFailure (AllegraEra c) where
  injectFailure :: ShelleyDelplPredFailure (AllegraEra c)
-> EraRuleFailure "LEDGERS" (AllegraEra c)
injectFailure = forall era.
PredicateFailure (EraRule "LEDGER" era)
-> ShelleyLedgersPredFailure era
LedgerFailure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (rule :: Symbol) (t :: * -> *) era.
InjectRuleFailure rule t era =>
t era -> EraRuleFailure rule era
injectFailure

instance InjectRuleFailure "LEDGERS" ShelleyPoolPredFailure (AllegraEra c) where
  injectFailure :: ShelleyPoolPredFailure (AllegraEra c)
-> EraRuleFailure "LEDGERS" (AllegraEra c)
injectFailure = forall era.
PredicateFailure (EraRule "LEDGER" era)
-> ShelleyLedgersPredFailure era
LedgerFailure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (rule :: Symbol) (t :: * -> *) era.
InjectRuleFailure rule t era =>
t era -> EraRuleFailure rule era
injectFailure

instance InjectRuleFailure "LEDGERS" ShelleyDelegPredFailure (AllegraEra c) where
  injectFailure :: ShelleyDelegPredFailure (AllegraEra c)
-> EraRuleFailure "LEDGERS" (AllegraEra c)
injectFailure = forall era.
PredicateFailure (EraRule "LEDGER" era)
-> ShelleyLedgersPredFailure era
LedgerFailure forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (rule :: Symbol) (t :: * -> *) era.
InjectRuleFailure rule t era =>
t era -> EraRuleFailure rule era
injectFailure