11{-# LANGUAGE DataKinds #-}
2- {-# LANGUAGE EmptyCase #-}
32{-# LANGUAGE FlexibleContexts #-}
43{-# LANGUAGE GADTs #-}
54{-# LANGUAGE NamedFieldPuns #-}
@@ -770,40 +769,19 @@ genTxCertificates =
770769 [ pure TxCertificatesNone
771770 , pure
772771 ( TxCertificates w $
773- fromList ((,BuildTxWith Nothing ) <$> map ( extractCertificate w) certs)
772+ fromList ((,BuildTxWith Nothing ) <$> map extractCertificate certs)
774773 )
775774 -- TODO: Generate certificates
776775 ]
777776 )
778777
779778extractCertificate
780- :: ShelleyBasedEra era
781- -> Api. Certificate era
779+ :: Api. Certificate era
782780 -> Exp. Certificate (ShelleyLedgerEra era )
783- extractCertificate ShelleyBasedEraShelley (Api. ShelleyRelatedCertificate _ c) =
784- Exp. Certificate c
785- extractCertificate ShelleyBasedEraAllegra (Api. ShelleyRelatedCertificate _ c) =
786- Exp. Certificate c
787- extractCertificate ShelleyBasedEraMary (Api. ShelleyRelatedCertificate _ c) =
788- Exp. Certificate c
789- extractCertificate ShelleyBasedEraAlonzo (Api. ShelleyRelatedCertificate _ c) =
790- Exp. Certificate c
791- extractCertificate ShelleyBasedEraBabbage (Api. ShelleyRelatedCertificate _ c) =
792- Exp. Certificate c
793- extractCertificate ShelleyBasedEraConway (Api. ShelleyRelatedCertificate sToBab _) =
794- case sToBab :: ShelleyToBabbageEra ConwayEra of {}
795- extractCertificate ShelleyBasedEraShelley (ConwayCertificate cOnwards _) =
796- case cOnwards :: ConwayEraOnwards ShelleyEra of {}
797- extractCertificate ShelleyBasedEraAllegra (ConwayCertificate cOnwards _) =
798- case cOnwards :: ConwayEraOnwards AllegraEra of {}
799- extractCertificate ShelleyBasedEraMary (ConwayCertificate cOnwards _) =
800- case cOnwards :: ConwayEraOnwards MaryEra of {}
801- extractCertificate ShelleyBasedEraAlonzo (ConwayCertificate cOnwards _) =
802- case cOnwards :: ConwayEraOnwards AlonzoEra of {}
803- extractCertificate ShelleyBasedEraBabbage (ConwayCertificate cOnwards _) =
804- case cOnwards :: ConwayEraOnwards BabbageEra of {}
805- extractCertificate ShelleyBasedEraConway (ConwayCertificate _ c) =
806- Exp. Certificate c
781+ extractCertificate (Api. ShelleyRelatedCertificate w c) =
782+ shelleyToBabbageEraConstraints w $ Exp. Certificate c
783+ extractCertificate (ConwayCertificate w c) =
784+ conwayEraOnwardsConstraints w $ Exp. Certificate c
807785
808786genScriptWitnessedTxCertificates :: Typeable era => Exp. Era era -> Gen (TxCertificates BuildTx era )
809787genScriptWitnessedTxCertificates era = do
@@ -815,7 +793,7 @@ genScriptWitnessedTxCertificates era = do
815793 let certsAndWits =
816794 zipWith
817795 (\ c p -> (c, Just p))
818- (map ( extractCertificate w) certs)
796+ (map extractCertificate certs)
819797 plutusScriptWits
820798
821799 pure $ mkTxCertificates (convert era) certsAndWits
0 commit comments