{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -Wno-orphans #-} module Cardano.Ledger.Babbage.TxWits ( module BabbageTxWitsReExport, ) where import Cardano.Ledger.Alonzo.TxWits ( AlonzoEraTxWits (..), AlonzoTxWits (..), addrAlonzoTxWitsL, bootAddrAlonzoTxWitsL, datsAlonzoTxWitsL, rdmrsAlonzoTxWitsL, scriptAlonzoTxWitsL, ) import Cardano.Ledger.Alonzo.TxWits as BabbageTxWitsReExport ( AlonzoEraTxWits (..), AlonzoTxWits (..), upgradeRedeemers, upgradeTxDats, ) import Cardano.Ledger.Babbage.Era (BabbageEra) import Cardano.Ledger.Babbage.TxBody () import Cardano.Ledger.Core instance EraTxWits BabbageEra where type TxWits BabbageEra = AlonzoTxWits BabbageEra mkBasicTxWits :: TxWits BabbageEra mkBasicTxWits = TxWits BabbageEra AlonzoTxWits BabbageEra forall a. Monoid a => a mempty addrTxWitsL :: Lens' (TxWits BabbageEra) (Set (WitVKey 'Witness)) addrTxWitsL = (Set (WitVKey 'Witness) -> f (Set (WitVKey 'Witness))) -> TxWits BabbageEra -> f (TxWits BabbageEra) (Set (WitVKey 'Witness) -> f (Set (WitVKey 'Witness))) -> AlonzoTxWits BabbageEra -> f (AlonzoTxWits BabbageEra) forall era. AlonzoEraScript era => Lens' (AlonzoTxWits era) (Set (WitVKey 'Witness)) Lens' (AlonzoTxWits BabbageEra) (Set (WitVKey 'Witness)) addrAlonzoTxWitsL {-# INLINE addrTxWitsL #-} bootAddrTxWitsL :: Lens' (TxWits BabbageEra) (Set BootstrapWitness) bootAddrTxWitsL = (Set BootstrapWitness -> f (Set BootstrapWitness)) -> TxWits BabbageEra -> f (TxWits BabbageEra) (Set BootstrapWitness -> f (Set BootstrapWitness)) -> AlonzoTxWits BabbageEra -> f (AlonzoTxWits BabbageEra) forall era. AlonzoEraScript era => Lens' (AlonzoTxWits era) (Set BootstrapWitness) Lens' (AlonzoTxWits BabbageEra) (Set BootstrapWitness) bootAddrAlonzoTxWitsL {-# INLINE bootAddrTxWitsL #-} scriptTxWitsL :: Lens' (TxWits BabbageEra) (Map ScriptHash (Script BabbageEra)) scriptTxWitsL = (Map ScriptHash (Script BabbageEra) -> f (Map ScriptHash (Script BabbageEra))) -> TxWits BabbageEra -> f (TxWits BabbageEra) (Map ScriptHash (Script BabbageEra) -> f (Map ScriptHash (Script BabbageEra))) -> AlonzoTxWits BabbageEra -> f (AlonzoTxWits BabbageEra) forall era. AlonzoEraScript era => Lens' (AlonzoTxWits era) (Map ScriptHash (Script era)) Lens' (AlonzoTxWits BabbageEra) (Map ScriptHash (Script BabbageEra)) scriptAlonzoTxWitsL {-# INLINE scriptTxWitsL #-} upgradeTxWits :: EraTxWits (PreviousEra BabbageEra) => TxWits (PreviousEra BabbageEra) -> TxWits BabbageEra upgradeTxWits TxWits (PreviousEra BabbageEra) atw = AlonzoTxWits { txwitsVKey :: Set (WitVKey 'Witness) txwitsVKey = AlonzoTxWits AlonzoEra -> Set (WitVKey 'Witness) forall era. AlonzoEraScript era => AlonzoTxWits era -> Set (WitVKey 'Witness) txwitsVKey TxWits (PreviousEra BabbageEra) AlonzoTxWits AlonzoEra atw , txwitsBoot :: Set BootstrapWitness txwitsBoot = AlonzoTxWits AlonzoEra -> Set BootstrapWitness forall era. AlonzoEraScript era => AlonzoTxWits era -> Set BootstrapWitness txwitsBoot TxWits (PreviousEra BabbageEra) AlonzoTxWits AlonzoEra atw , txscripts :: Map ScriptHash (Script BabbageEra) txscripts = Script (PreviousEra BabbageEra) -> Script BabbageEra forall era. (EraScript era, EraScript (PreviousEra era)) => Script (PreviousEra era) -> Script era upgradeScript (Script (PreviousEra BabbageEra) -> Script BabbageEra) -> Map ScriptHash (Script (PreviousEra BabbageEra)) -> Map ScriptHash (Script BabbageEra) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> AlonzoTxWits (PreviousEra BabbageEra) -> Map ScriptHash (Script (PreviousEra BabbageEra)) forall era. AlonzoEraScript era => AlonzoTxWits era -> Map ScriptHash (Script era) txscripts TxWits (PreviousEra BabbageEra) AlonzoTxWits (PreviousEra BabbageEra) atw , txdats :: TxDats BabbageEra txdats = TxDats AlonzoEra -> TxDats BabbageEra forall era1 era2. (Era era1, Era era2) => TxDats era1 -> TxDats era2 upgradeTxDats (AlonzoTxWits AlonzoEra -> TxDats AlonzoEra forall era. AlonzoEraScript era => AlonzoTxWits era -> TxDats era txdats TxWits (PreviousEra BabbageEra) AlonzoTxWits AlonzoEra atw) , txrdmrs :: Redeemers BabbageEra txrdmrs = Redeemers (PreviousEra BabbageEra) -> Redeemers BabbageEra forall era. (AlonzoEraScript (PreviousEra era), AlonzoEraScript era) => Redeemers (PreviousEra era) -> Redeemers era upgradeRedeemers (AlonzoTxWits AlonzoEra -> Redeemers AlonzoEra forall era. AlonzoEraScript era => AlonzoTxWits era -> Redeemers era txrdmrs TxWits (PreviousEra BabbageEra) AlonzoTxWits AlonzoEra atw) } instance AlonzoEraTxWits BabbageEra where datsTxWitsL :: Lens' (TxWits BabbageEra) (TxDats BabbageEra) datsTxWitsL = (TxDats BabbageEra -> f (TxDats BabbageEra)) -> TxWits BabbageEra -> f (TxWits BabbageEra) (TxDats BabbageEra -> f (TxDats BabbageEra)) -> AlonzoTxWits BabbageEra -> f (AlonzoTxWits BabbageEra) forall era. AlonzoEraScript era => Lens' (AlonzoTxWits era) (TxDats era) Lens' (AlonzoTxWits BabbageEra) (TxDats BabbageEra) datsAlonzoTxWitsL {-# INLINE datsTxWitsL #-} rdmrsTxWitsL :: Lens' (TxWits BabbageEra) (Redeemers BabbageEra) rdmrsTxWitsL = (Redeemers BabbageEra -> f (Redeemers BabbageEra)) -> TxWits BabbageEra -> f (TxWits BabbageEra) (Redeemers BabbageEra -> f (Redeemers BabbageEra)) -> AlonzoTxWits BabbageEra -> f (AlonzoTxWits BabbageEra) forall era. AlonzoEraScript era => Lens' (AlonzoTxWits era) (Redeemers era) Lens' (AlonzoTxWits BabbageEra) (Redeemers BabbageEra) rdmrsAlonzoTxWitsL {-# INLINE rdmrsTxWitsL #-}