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

module Cardano.Ledger.Mary.Rules.Utxow () where

import Cardano.Ledger.Allegra.Rules (AllegraUtxoPredFailure)
import Cardano.Ledger.Core
import Cardano.Ledger.Mary.Era (MaryEra)
import Cardano.Ledger.Mary.Rules.Utxo ()
import Cardano.Ledger.Shelley.Rules (
  ShelleyPpupPredFailure,
  ShelleyUtxoPredFailure,
  ShelleyUtxowPredFailure (..),
 )

type instance EraRuleFailure "UTXOW" (MaryEra c) = ShelleyUtxowPredFailure (MaryEra c)

instance InjectRuleFailure "UTXOW" ShelleyUtxowPredFailure (MaryEra c)

instance InjectRuleFailure "UTXOW" AllegraUtxoPredFailure (MaryEra c) where
  injectFailure :: AllegraUtxoPredFailure (MaryEra c)
-> EraRuleFailure "UTXOW" (MaryEra c)
injectFailure = forall era.
PredicateFailure (EraRule "UTXO" era)
-> ShelleyUtxowPredFailure era
UtxoFailure

instance InjectRuleFailure "UTXOW" ShelleyUtxoPredFailure (MaryEra c) where
  injectFailure :: ShelleyUtxoPredFailure (MaryEra c)
-> EraRuleFailure "UTXOW" (MaryEra c)
injectFailure = forall era.
PredicateFailure (EraRule "UTXO" era)
-> ShelleyUtxowPredFailure era
UtxoFailure 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 "UTXOW" ShelleyPpupPredFailure (MaryEra c) where
  injectFailure :: ShelleyPpupPredFailure (MaryEra c)
-> EraRuleFailure "UTXOW" (MaryEra c)
injectFailure = forall era.
PredicateFailure (EraRule "UTXO" era)
-> ShelleyUtxowPredFailure era
UtxoFailure 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