11{-# LANGUAGE DataKinds #-}
2- {-# LANGUAGE EmptyCase #-}
32{-# LANGUAGE FlexibleContexts #-}
43{-# LANGUAGE GADTs #-}
54{-# LANGUAGE NamedFieldPuns #-}
@@ -794,40 +793,19 @@ genTxCertificates =
794793 [ pure TxCertificatesNone
795794 , pure
796795 ( TxCertificates w $
797- fromList ((,BuildTxWith Nothing ) <$> map ( extractCertificate w) certs)
796+ fromList ((,BuildTxWith Nothing ) <$> map extractCertificate certs)
798797 )
799798 -- TODO: Generate certificates
800799 ]
801800 )
802801
803802extractCertificate
804- :: ShelleyBasedEra era
805- -> Api. Certificate era
803+ :: Api. Certificate era
806804 -> Exp. Certificate (ShelleyLedgerEra era )
807- extractCertificate ShelleyBasedEraShelley (Api. ShelleyRelatedCertificate _ c) =
808- Exp. Certificate c
809- extractCertificate ShelleyBasedEraAllegra (Api. ShelleyRelatedCertificate _ c) =
810- Exp. Certificate c
811- extractCertificate ShelleyBasedEraMary (Api. ShelleyRelatedCertificate _ c) =
812- Exp. Certificate c
813- extractCertificate ShelleyBasedEraAlonzo (Api. ShelleyRelatedCertificate _ c) =
814- Exp. Certificate c
815- extractCertificate ShelleyBasedEraBabbage (Api. ShelleyRelatedCertificate _ c) =
816- Exp. Certificate c
817- extractCertificate ShelleyBasedEraConway (Api. ShelleyRelatedCertificate sToBab _) =
818- case sToBab :: ShelleyToBabbageEra ConwayEra of {}
819- extractCertificate ShelleyBasedEraShelley (ConwayCertificate cOnwards _) =
820- case cOnwards :: ConwayEraOnwards ShelleyEra of {}
821- extractCertificate ShelleyBasedEraAllegra (ConwayCertificate cOnwards _) =
822- case cOnwards :: ConwayEraOnwards AllegraEra of {}
823- extractCertificate ShelleyBasedEraMary (ConwayCertificate cOnwards _) =
824- case cOnwards :: ConwayEraOnwards MaryEra of {}
825- extractCertificate ShelleyBasedEraAlonzo (ConwayCertificate cOnwards _) =
826- case cOnwards :: ConwayEraOnwards AlonzoEra of {}
827- extractCertificate ShelleyBasedEraBabbage (ConwayCertificate cOnwards _) =
828- case cOnwards :: ConwayEraOnwards BabbageEra of {}
829- extractCertificate ShelleyBasedEraConway (ConwayCertificate _ c) =
830- Exp. Certificate c
805+ extractCertificate (Api. ShelleyRelatedCertificate w c) =
806+ shelleyToBabbageEraConstraints w $ Exp. Certificate c
807+ extractCertificate (ConwayCertificate w c) =
808+ conwayEraOnwardsConstraints w $ Exp. Certificate c
831809
832810genScriptWitnessedTxCertificates :: Typeable era => Exp. Era era -> Gen (TxCertificates BuildTx era )
833811genScriptWitnessedTxCertificates era = do
@@ -839,7 +817,7 @@ genScriptWitnessedTxCertificates era = do
839817 let certsAndWits =
840818 zipWith
841819 (\ c p -> (c, Just p))
842- (map ( extractCertificate w) certs)
820+ (map extractCertificate certs)
843821 plutusScriptWits
844822
845823 pure $ mkTxCertificates (convert era) certsAndWits
0 commit comments