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

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

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

type instance EraRuleFailure "UTXO" (MaryEra c) = AllegraUtxoPredFailure (MaryEra c)

instance InjectRuleFailure "UTXO" AllegraUtxoPredFailure (MaryEra c)

instance InjectRuleFailure "UTXO" ShelleyUtxoPredFailure (MaryEra c) where
  injectFailure :: ShelleyUtxoPredFailure (MaryEra c)
-> EraRuleFailure "UTXO" (MaryEra c)
injectFailure = forall era.
ShelleyUtxoPredFailure era -> AllegraUtxoPredFailure era
shelleyToAllegraUtxoPredFailure

instance InjectRuleFailure "UTXO" ShelleyPpupPredFailure (MaryEra c) where
  injectFailure :: ShelleyPpupPredFailure (MaryEra c)
-> EraRuleFailure "UTXO" (MaryEra c)
injectFailure = forall era. EraRuleFailure "PPUP" era -> AllegraUtxoPredFailure era
UpdateFailure