@@ -575,7 +575,7 @@ data TxCertificates build era where
575
575
TxCertificates
576
576
:: ShelleyBasedEra era
577
577
-> OMap
578
- (Exp. Certificate era )
578
+ (Exp. Certificate ( ShelleyLedgerEra era ) )
579
579
( BuildTxWith
580
580
build
581
581
(Maybe (StakeCredential , Witness WitCtxStake era ))
@@ -594,29 +594,40 @@ deriving instance Show (TxCertificates build era)
594
594
-- credential registration certificates without a deposit. Future eras will require a witness for
595
595
-- registration certificates, because the one without a deposit will be removed.
596
596
mkTxCertificates
597
- :: Applicative (BuildTxWith build )
597
+ :: forall era build
598
+ . Applicative (BuildTxWith build )
598
599
=> ShelleyBasedEra era
599
- -> [(Certificate era , Maybe (ScriptWitness WitCtxStake era ))]
600
+ -> [(Exp. Certificate ( ShelleyLedgerEra era ) , Maybe (ScriptWitness WitCtxStake era ))]
600
601
-> TxCertificates build era
601
602
mkTxCertificates _ [] = TxCertificatesNone
602
603
mkTxCertificates sbe certs = TxCertificates sbe . fromList $ map getStakeCred certs
603
604
where
604
- getStakeCred (cert, mWit) = do
605
+ getStakeCred
606
+ :: (Exp. Certificate (ShelleyLedgerEra era ), Maybe (ScriptWitness WitCtxStake era ))
607
+ -> ( Exp. Certificate (ShelleyLedgerEra era )
608
+ , BuildTxWith build (Maybe (StakeCredential , Witness WitCtxStake era ))
609
+ )
610
+ getStakeCred (c@ (Exp. Certificate cert), mWit) = do
605
611
let wit =
606
612
maybe
607
613
(KeyWitness KeyWitnessForStakeAddr )
608
614
(ScriptWitness ScriptWitnessForStakeAddr )
609
615
mWit
610
- ( cert
616
+ ( c
611
617
, pure $
612
- (,wit) <$> selectStakeCredentialWitness cert
618
+ (,wit) <$> getTxCertWitness sbe cert
613
619
)
614
620
615
621
-- | Index certificates with witnesses by the order they appear in the list (in the transaction).
616
622
-- See section 4.1 of https://github.com/intersectmbo/cardano-ledger/releases/latest/download/alonzo-ledger.pdf
617
623
indexTxCertificates
618
624
:: TxCertificates BuildTx era
619
- -> [(ScriptWitnessIndex , Certificate era , StakeCredential , Witness WitCtxStake era )]
625
+ -> [ ( ScriptWitnessIndex
626
+ , Exp. Certificate (ShelleyLedgerEra era )
627
+ , StakeCredential
628
+ , Witness WitCtxStake era
629
+ )
630
+ ]
620
631
indexTxCertificates TxCertificatesNone = []
621
632
indexTxCertificates (TxCertificates _ certsWits) =
622
633
[ (ScriptWitnessIndexCertificate ix, cert, stakeCred, witness)
@@ -1760,7 +1771,7 @@ fromLedgerTxCertificates sbe body =
1760
1771
in if null certificates
1761
1772
then TxCertificatesNone
1762
1773
else
1763
- TxCertificates sbe . fromList $ map ((,ViewTx ) . fromShelleyCertificate sbe ) $ toList certificates
1774
+ TxCertificates sbe . fromList $ map ((,ViewTx ) . Exp. Certificate ) $ toList certificates
1764
1775
1765
1776
maybeFromLedgerTxUpdateProposal
1766
1777
:: ()
@@ -1844,7 +1855,7 @@ convCertificates
1844
1855
-> Seq. StrictSeq (Shelley. TxCert (ShelleyLedgerEra era ))
1845
1856
convCertificates _ = \ case
1846
1857
TxCertificatesNone -> Seq. empty
1847
- TxCertificates _ cs -> fromList . map (toShelleyCertificate . fst ) $ toList cs
1858
+ TxCertificates _ cs -> fromList . map (\ ( Exp. Certificate c, _) -> c ) $ toList cs
1848
1859
1849
1860
convWithdrawals :: TxWithdrawals build era -> L. Withdrawals
1850
1861
convWithdrawals txWithdrawals =
@@ -2981,10 +2992,10 @@ extractWitnessableCertificates
2981
2992
extractWitnessableCertificates aeon txCertificates =
2982
2993
alonzoEraOnwardsConstraints aeon $
2983
2994
List. nub
2984
- [ ( WitTxCert (certificateToTxCert cert) stakeCred
2995
+ [ ( WitTxCert cert stakeCred
2985
2996
, BuildTxWith wit
2986
2997
)
2987
- | (cert, BuildTxWith (Just (stakeCred, wit))) <- getCertificates txCertificates
2998
+ | (Exp. Certificate cert, BuildTxWith (Just (stakeCred, wit))) <- getCertificates txCertificates
2988
2999
]
2989
3000
where
2990
3001
getCertificates TxCertificatesNone = []
0 commit comments