@@ -63,24 +63,24 @@ import Data.Sequence.Strict (StrictSeq)
6363import qualified Data.Sequence.Strict as StrictSeq
6464import qualified Data.Set as Set
6565import Lens.Micro
66- import Ouroboros.Consensus.Cardano.Block (LedgerState , StandardAlonzo )
66+ import Ouroboros.Consensus.Cardano.Block (AlonzoEra , LedgerState )
6767import Ouroboros.Consensus.Shelley.Eras (StandardCrypto )
6868import Ouroboros.Consensus.Shelley.Ledger (ShelleyBlock )
6969import Prelude hiding (map )
7070
71- type AlonzoUTxOIndex = UTxOIndex StandardAlonzo
71+ type AlonzoUTxOIndex = UTxOIndex AlonzoEra
7272
73- type AlonzoLedgerState = LedgerState (ShelleyBlock TPraosStandard StandardAlonzo )
73+ type AlonzoLedgerState = LedgerState (ShelleyBlock TPraosStandard AlonzoEra )
7474
7575consTxBody ::
7676 Set (TxIn StandardCrypto ) ->
7777 Set (TxIn StandardCrypto ) ->
78- StrictSeq (AlonzoTxOut StandardAlonzo ) ->
78+ StrictSeq (AlonzoTxOut AlonzoEra ) ->
7979 Coin ->
8080 MultiAsset StandardCrypto ->
81- [ShelleyTxCert StandardAlonzo ] ->
81+ [ShelleyTxCert AlonzoEra ] ->
8282 Withdrawals StandardCrypto ->
83- AlonzoTxBody StandardAlonzo
83+ AlonzoTxBody AlonzoEra
8484consTxBody ins cols outs fees minted certs wdrl =
8585 AlonzoTxBody
8686 ins
@@ -111,13 +111,13 @@ addValidityInterval slotNo tx =
111111consPaymentTxBody ::
112112 Set (TxIn StandardCrypto ) ->
113113 Set (TxIn StandardCrypto ) ->
114- StrictSeq (AlonzoTxOut StandardAlonzo ) ->
114+ StrictSeq (AlonzoTxOut AlonzoEra ) ->
115115 Coin ->
116116 MultiAsset StandardCrypto ->
117- AlonzoTxBody StandardAlonzo
117+ AlonzoTxBody AlonzoEra
118118consPaymentTxBody ins cols outs fees minted = consTxBody ins cols outs fees minted mempty (Withdrawals mempty )
119119
120- consCertTxBody :: [ShelleyTxCert StandardAlonzo ] -> Withdrawals StandardCrypto -> AlonzoTxBody StandardAlonzo
120+ consCertTxBody :: [ShelleyTxCert AlonzoEra ] -> Withdrawals StandardCrypto -> AlonzoTxBody AlonzoEra
121121consCertTxBody = consTxBody mempty mempty mempty (Coin 0 ) mempty
122122
123123mkPaymentTx ::
@@ -126,7 +126,7 @@ mkPaymentTx ::
126126 Integer ->
127127 Integer ->
128128 AlonzoLedgerState ->
129- Either ForgingError (AlonzoTx StandardAlonzo )
129+ Either ForgingError (AlonzoTx AlonzoEra )
130130mkPaymentTx inputIndex outputIndex amount fees sta = do
131131 (inputPair, _) <- resolveUTxOIndex inputIndex sta
132132 addr <- resolveAddress outputIndex sta
@@ -141,7 +141,7 @@ mkPaymentTx' ::
141141 AlonzoUTxOIndex ->
142142 [(AlonzoUTxOIndex , MaryValue StandardCrypto )] ->
143143 AlonzoLedgerState ->
144- Either ForgingError (AlonzoTx StandardAlonzo )
144+ Either ForgingError (AlonzoTx AlonzoEra )
145145mkPaymentTx' inputIndex outputIndex sta = do
146146 inputPair <- fst <$> resolveUTxOIndex inputIndex sta
147147 outps <- mapM mkOuts outputIndex
@@ -162,7 +162,7 @@ mkLockByScriptTx ::
162162 Integer ->
163163 Integer ->
164164 AlonzoLedgerState ->
165- Either ForgingError (AlonzoTx StandardAlonzo )
165+ Either ForgingError (AlonzoTx AlonzoEra )
166166mkLockByScriptTx inputIndex spendable amount fees sta = do
167167 (inputPair, _) <- resolveUTxOIndex inputIndex sta
168168
@@ -173,7 +173,7 @@ mkLockByScriptTx inputIndex spendable amount fees sta = do
173173 -- No witnesses are necessary when the outputs is a script address. Only when it's consumed.
174174 Right $ mkSimpleTx True $ consPaymentTxBody input mempty (StrictSeq. fromList $ outs <> [change]) (Coin fees) mempty
175175 where
176- datahash = hashData @ StandardAlonzo plutusDataList
176+ datahash = hashData @ AlonzoEra plutusDataList
177177 mkOut sp =
178178 let outAddress = if sp then alwaysSucceedsScriptAddr else alwaysFailsScriptAddr
179179 in AlonzoTxOut outAddress (valueFromList (Coin amount) [] ) (Strict. SJust datahash)
@@ -186,7 +186,7 @@ mkUnlockScriptTx ::
186186 Integer ->
187187 Integer ->
188188 AlonzoLedgerState ->
189- Either ForgingError (AlonzoTx StandardAlonzo )
189+ Either ForgingError (AlonzoTx AlonzoEra )
190190mkUnlockScriptTx inputIndex colInputIndex outputIndex succeeds amount fees sta = do
191191 inputPairs <- fmap fst <$> mapM (`resolveUTxOIndex` sta) inputIndex
192192 (colInputPair, _) <- resolveUTxOIndex colInputIndex sta
@@ -202,13 +202,13 @@ mkUnlockScriptTx inputIndex colInputIndex outputIndex succeeds amount fees sta =
202202 $ consPaymentTxBody inpts colInput (StrictSeq. fromList [output]) (Coin fees) mempty
203203
204204mkScriptInp' ::
205- (Word64 , (TxIn StandardCrypto , Core. TxOut StandardAlonzo )) ->
206- Maybe (AlonzoPlutusPurpose AsIx era , Maybe (ScriptHash StandardCrypto , Core. Script StandardAlonzo ))
205+ (Word64 , (TxIn StandardCrypto , Core. TxOut AlonzoEra )) ->
206+ Maybe (AlonzoPlutusPurpose AsIx era , Maybe (ScriptHash StandardCrypto , Core. Script AlonzoEra ))
207207mkScriptInp' = map (second Just ) . mkScriptInp
208208
209209mkScriptInp ::
210- (Word64 , (TxIn StandardCrypto , Core. TxOut StandardAlonzo )) ->
211- Maybe (AlonzoPlutusPurpose AsIx era , (ScriptHash StandardCrypto , Core. Script StandardAlonzo ))
210+ (Word64 , (TxIn StandardCrypto , Core. TxOut AlonzoEra )) ->
211+ Maybe (AlonzoPlutusPurpose AsIx era , (ScriptHash StandardCrypto , Core. Script AlonzoEra ))
212212mkScriptInp (n, (_txIn, txOut))
213213 | addr == alwaysFailsScriptAddr =
214214 Just
@@ -252,7 +252,7 @@ mkMAssetsScriptTx ::
252252 Bool ->
253253 Integer ->
254254 AlonzoLedgerState ->
255- Either ForgingError (AlonzoTx StandardAlonzo )
255+ Either ForgingError (AlonzoTx AlonzoEra )
256256mkMAssetsScriptTx inputIndex colInputIndex outputIndex minted succeeds fees sta = do
257257 inputPairs <- fmap fst <$> mapM (`resolveUTxOIndex` sta) inputIndex
258258 colInput <- Set. singleton . fst . fst <$> resolveUTxOIndex colInputIndex sta
@@ -269,18 +269,18 @@ mkMAssetsScriptTx inputIndex colInputIndex outputIndex minted succeeds fees sta
269269 where
270270 mkOuts (outIx, vl) = do
271271 addr <- resolveAddress outIx sta
272- Right $ AlonzoTxOut addr vl (Strict. SJust (hashData @ StandardAlonzo plutusDataList))
272+ Right $ AlonzoTxOut addr vl (Strict. SJust (hashData @ AlonzoEra plutusDataList))
273273
274274mkDCertTx ::
275- [ShelleyTxCert StandardAlonzo ] ->
275+ [ShelleyTxCert AlonzoEra ] ->
276276 Withdrawals StandardCrypto ->
277- Either ForgingError (AlonzoTx StandardAlonzo )
277+ Either ForgingError (AlonzoTx AlonzoEra )
278278mkDCertTx certs wdrl = Right $ mkSimpleTx True $ consCertTxBody certs wdrl
279279
280280mkSimpleDCertTx ::
281- [(StakeIndex , StakeCredential StandardCrypto -> ShelleyTxCert StandardAlonzo )] ->
281+ [(StakeIndex , StakeCredential -> ShelleyTxCert AlonzoEra )] ->
282282 AlonzoLedgerState ->
283- Either ForgingError (AlonzoTx StandardAlonzo )
283+ Either ForgingError (AlonzoTx AlonzoEra )
284284mkSimpleDCertTx consDert st = do
285285 dcerts <- forM consDert $ \ (stakeIndex, mkDCert) -> do
286286 cred <- resolveStakeCreds stakeIndex st
@@ -290,11 +290,11 @@ mkSimpleDCertTx consDert st = do
290290mkDCertPoolTx ::
291291 [ ( [StakeIndex ]
292292 , PoolIndex
293- , [StakeCredential StandardCrypto ] -> KeyHash 'StakePool StandardCrypto -> ShelleyTxCert StandardAlonzo
293+ , [StakeCredential ] -> KeyHash 'StakePool -> ShelleyTxCert AlonzoEra
294294 )
295295 ] ->
296296 AlonzoLedgerState ->
297- Either ForgingError (AlonzoTx StandardAlonzo )
297+ Either ForgingError (AlonzoTx AlonzoEra )
298298mkDCertPoolTx consDert st = do
299299 dcerts <- forM consDert $ \ (stakeIxs, poolIx, mkDCert) -> do
300300 stakeCreds <- forM stakeIxs $ \ stix -> resolveStakeCreds stix st
@@ -303,10 +303,10 @@ mkDCertPoolTx consDert st = do
303303 mkDCertTx dcerts (Withdrawals mempty )
304304
305305mkScriptDCertTx ::
306- [(StakeIndex , Bool , StakeCredential StandardCrypto -> ShelleyTxCert StandardAlonzo )] ->
306+ [(StakeIndex , Bool , StakeCredential -> ShelleyTxCert AlonzoEra )] ->
307307 Bool ->
308308 AlonzoLedgerState ->
309- Either ForgingError (AlonzoTx StandardAlonzo )
309+ Either ForgingError (AlonzoTx AlonzoEra )
310310mkScriptDCertTx consDert valid st = do
311311 dcerts <- forM consDert $ \ (stakeIndex, _, mkDCert) -> do
312312 cred <- resolveStakeCreds stakeIndex st
@@ -329,7 +329,7 @@ mkDepositTxPools ::
329329 AlonzoUTxOIndex ->
330330 Integer ->
331331 AlonzoLedgerState ->
332- Either ForgingError (AlonzoTx StandardAlonzo )
332+ Either ForgingError (AlonzoTx AlonzoEra )
333333mkDepositTxPools inputIndex deposit sta = do
334334 (inputPair, _) <- resolveUTxOIndex inputIndex sta
335335
@@ -340,10 +340,10 @@ mkDepositTxPools inputIndex deposit sta = do
340340
341341mkDCertTxPools ::
342342 AlonzoLedgerState ->
343- Either ForgingError (AlonzoTx StandardAlonzo )
343+ Either ForgingError (AlonzoTx AlonzoEra )
344344mkDCertTxPools sta = Right $ mkSimpleTx True $ consCertTxBody (allPoolStakeCert sta) (Withdrawals mempty )
345345
346- mkSimpleTx :: Bool -> AlonzoTxBody StandardAlonzo -> AlonzoTx StandardAlonzo
346+ mkSimpleTx :: Bool -> AlonzoTxBody AlonzoEra -> AlonzoTx AlonzoEra
347347mkSimpleTx valid txBody =
348348 AlonzoTx
349349 { body = txBody
@@ -353,9 +353,9 @@ mkSimpleTx valid txBody =
353353 }
354354
355355consPoolParamsTwoOwners ::
356- [StakeCredential StandardCrypto ] ->
357- KeyHash 'StakePool StandardCrypto ->
358- ShelleyTxCert StandardAlonzo
356+ [StakeCredential ] ->
357+ KeyHash 'StakePool ->
358+ ShelleyTxCert AlonzoEra
359359consPoolParamsTwoOwners [rwCred, KeyHashObj owner0, KeyHashObj owner1] poolId =
360360 ShelleyTxCertPool $ RegPool $ consPoolParams poolId rwCred [owner0, owner1]
361361consPoolParamsTwoOwners _ _ = panic " expected 2 pool owners"
@@ -417,7 +417,7 @@ mkUTxOAlonzo tx =
417417 transId = txIdTx tx
418418 outputsL = Core. bodyTxL . Core. outputsTxBodyL
419419
420- emptyTxBody :: AlonzoTxBody StandardAlonzo
420+ emptyTxBody :: AlonzoTxBody AlonzoEra
421421emptyTxBody =
422422 AlonzoTxBody
423423 mempty
@@ -434,7 +434,7 @@ emptyTxBody =
434434 Strict. SNothing
435435 (Strict. SJust Testnet )
436436
437- emptyTx :: AlonzoTx StandardAlonzo
437+ emptyTx :: AlonzoTx AlonzoEra
438438emptyTx =
439439 AlonzoTx
440440 { body = emptyTxBody
0 commit comments