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