{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Cardano.Api.LedgerEvents.Rule.BBODY.LEDGER ( LatestBBodyEventConstraints , handleShelleyLEDGEREvents ) where import Cardano.Api.LedgerEvents.LedgerEvent import Cardano.Api.LedgerEvents.Rule.BBODY.DELEGS import Cardano.Api.LedgerEvents.Rule.BBODY.UTXOW import Cardano.Ledger.Alonzo.Rules (AlonzoUtxoEvent (..), AlonzoUtxosEvent (..), AlonzoUtxowEvent (..)) import qualified Cardano.Ledger.Alonzo.Rules as Alonzo import qualified Cardano.Ledger.Core as Ledger.Core import qualified Cardano.Ledger.Crypto as Crypto import qualified Cardano.Ledger.Shelley.Rules as Shelley import Control.State.Transition.Extended type LatestBBodyEventConstraints ledgerera = ( Event (Ledger.Core.EraRule "BBODY" ledgerera) ~ Alonzo.AlonzoBbodyEvent ledgerera , Event (Ledger.Core.EraRule "LEDGERS" ledgerera) ~ Shelley.ShelleyLedgersEvent ledgerera , Event (Ledger.Core.EraRule "LEDGER" ledgerera) ~ Shelley.ShelleyLedgerEvent ledgerera , Event (Ledger.Core.EraRule "DELEGS" ledgerera) ~ Shelley.ShelleyDelegsEvent ledgerera , Event (Ledger.Core.EraRule "UTXOW" ledgerera) ~ AlonzoUtxowEvent ledgerera , Event (Ledger.Core.EraRule "UTXO" ledgerera) ~ AlonzoUtxoEvent ledgerera , Event (Ledger.Core.EraRule "UTXOS" ledgerera) ~ AlonzoUtxosEvent ledgerera ) handleShelleyLEDGEREvents :: Event (Ledger.Core.EraRule "UTXOW" ledgerera) ~ AlonzoUtxowEvent ledgerera => Event (Ledger.Core.EraRule "UTXO" ledgerera) ~ AlonzoUtxoEvent ledgerera => Event (Ledger.Core.EraRule "UTXOS" ledgerera) ~ AlonzoUtxosEvent ledgerera => Event (Ledger.Core.EraRule "DELEGS" ledgerera) ~ Shelley.ShelleyDelegsEvent ledgerera => Ledger.Core.EraCrypto ledgerera ~ Crypto.StandardCrypto => Shelley.ShelleyLedgerEvent ledgerera -> Maybe LedgerEvent handleShelleyLEDGEREvents :: forall ledgerera. (Event (EraRule "UTXOW" ledgerera) ~ AlonzoUtxowEvent ledgerera, Event (EraRule "UTXO" ledgerera) ~ AlonzoUtxoEvent ledgerera, Event (EraRule "UTXOS" ledgerera) ~ AlonzoUtxosEvent ledgerera, Event (EraRule "DELEGS" ledgerera) ~ ShelleyDelegsEvent ledgerera, EraCrypto ledgerera ~ StandardCrypto) => ShelleyLedgerEvent ledgerera -> Maybe LedgerEvent handleShelleyLEDGEREvents ShelleyLedgerEvent ledgerera ledgerEvent = case ShelleyLedgerEvent ledgerera ledgerEvent of Shelley.UtxowEvent Event (EraRule "UTXOW" ledgerera) e -> AlonzoUtxowEvent ledgerera -> Maybe LedgerEvent forall ledgerera. (Event (EraRule "UTXO" ledgerera) ~ AlonzoUtxoEvent ledgerera, Event (EraRule "UTXOS" ledgerera) ~ AlonzoUtxosEvent ledgerera, EraCrypto ledgerera ~ StandardCrypto) => AlonzoUtxowEvent ledgerera -> Maybe LedgerEvent handleAlonzoUTxOWEvent AlonzoUtxowEvent ledgerera Event (EraRule "UTXOW" ledgerera) e Shelley.DelegsEvent Event (EraRule "DELEGS" ledgerera) e -> ShelleyDelegsEvent ledgerera -> Maybe LedgerEvent forall ledgerera. ShelleyDelegsEvent ledgerera -> Maybe LedgerEvent handleShelleyDELEGSEvent Event (EraRule "DELEGS" ledgerera) ShelleyDelegsEvent ledgerera e