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

module Cardano.Ledger.Mary.CertState () where

import Cardano.Ledger.CertState
import Cardano.Ledger.Mary.Era (MaryEra)
import Cardano.Ledger.Shelley.CertState
import Data.Coerce (coerce)

instance EraCertState MaryEra where
  type CertState MaryEra = ShelleyCertState MaryEra

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

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

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

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

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

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

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

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