{-# 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 = ShelleyUtxowPredFailure MaryEra

instance InjectRuleFailure "UTXOW" ShelleyUtxowPredFailure MaryEra

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

instance InjectRuleFailure "UTXOW" ShelleyUtxoPredFailure MaryEra where
  injectFailure :: ShelleyUtxoPredFailure MaryEra -> EraRuleFailure "UTXOW" MaryEra
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 where
  injectFailure :: ShelleyPpupPredFailure MaryEra -> EraRuleFailure "UTXOW" MaryEra
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