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

module Cardano.Ledger.Babbage.CertState () where

import Cardano.Ledger.Babbage.Era (BabbageEra)
import Cardano.Ledger.CertState
import Cardano.Ledger.Shelley.CertState
import Data.Coerce (coerce)

instance EraCertState BabbageEra where
  type CertState BabbageEra = ShelleyCertState BabbageEra

  mkCertState :: VState BabbageEra
-> PState BabbageEra -> DState BabbageEra -> CertState BabbageEra
mkCertState = forall era.
VState era -> PState era -> DState era -> ShelleyCertState era
mkShelleyCertState

  upgradeCertState :: EraCertState (PreviousEra BabbageEra) =>
CertState (PreviousEra BabbageEra) -> CertState BabbageEra
upgradeCertState = coerce :: forall a b. Coercible a b => a -> b
coerce

  certDStateL :: Lens' (CertState BabbageEra) (DState BabbageEra)
certDStateL = forall era. Lens' (ShelleyCertState era) (DState era)
shelleyCertDStateL
  {-# INLINE certDStateL #-}

  certVStateL :: Lens' (CertState BabbageEra) (VState BabbageEra)
certVStateL = forall era. Lens' (ShelleyCertState era) (VState era)
shelleyCertVStateL
  {-# INLINE certVStateL #-}

  certPStateL :: Lens' (CertState BabbageEra) (PState BabbageEra)
certPStateL = forall era. Lens' (ShelleyCertState era) (PState era)
shelleyCertPStateL
  {-# INLINE certPStateL #-}

  obligationCertState :: CertState BabbageEra -> Obligations
obligationCertState = forall era. ShelleyCertState era -> Obligations
shelleyObligationCertState

  certsTotalDepositsTxBody :: EraTxBody BabbageEra =>
PParams BabbageEra
-> CertState BabbageEra -> TxBody BabbageEra -> Coin
certsTotalDepositsTxBody = forall era.
EraTxBody era =>
PParams era -> ShelleyCertState era -> TxBody era -> Coin
shelleyCertsTotalDepositsTxBody

  certsTotalRefundsTxBody :: EraTxBody BabbageEra =>
PParams BabbageEra
-> CertState BabbageEra -> TxBody BabbageEra -> Coin
certsTotalRefundsTxBody = forall era.
EraTxBody era =>
PParams era -> ShelleyCertState era -> TxBody era -> Coin
shelleyCertsTotalRefundsTxBody