@@ -63,24 +63,24 @@ import Data.Sequence.Strict (StrictSeq)
63
63
import qualified Data.Sequence.Strict as StrictSeq
64
64
import qualified Data.Set as Set
65
65
import Lens.Micro
66
- import Ouroboros.Consensus.Cardano.Block (LedgerState , StandardAlonzo )
66
+ import Ouroboros.Consensus.Cardano.Block (AlonzoEra , LedgerState )
67
67
import Ouroboros.Consensus.Shelley.Eras (StandardCrypto )
68
68
import Ouroboros.Consensus.Shelley.Ledger (ShelleyBlock )
69
69
import Prelude hiding (map )
70
70
71
- type AlonzoUTxOIndex = UTxOIndex StandardAlonzo
71
+ type AlonzoUTxOIndex = UTxOIndex AlonzoEra
72
72
73
- type AlonzoLedgerState = LedgerState (ShelleyBlock TPraosStandard StandardAlonzo )
73
+ type AlonzoLedgerState = LedgerState (ShelleyBlock TPraosStandard AlonzoEra )
74
74
75
75
consTxBody ::
76
76
Set (TxIn StandardCrypto ) ->
77
77
Set (TxIn StandardCrypto ) ->
78
- StrictSeq (AlonzoTxOut StandardAlonzo ) ->
78
+ StrictSeq (AlonzoTxOut AlonzoEra ) ->
79
79
Coin ->
80
80
MultiAsset StandardCrypto ->
81
- [ShelleyTxCert StandardAlonzo ] ->
81
+ [ShelleyTxCert AlonzoEra ] ->
82
82
Withdrawals StandardCrypto ->
83
- AlonzoTxBody StandardAlonzo
83
+ AlonzoTxBody AlonzoEra
84
84
consTxBody ins cols outs fees minted certs wdrl =
85
85
AlonzoTxBody
86
86
ins
@@ -111,13 +111,13 @@ addValidityInterval slotNo tx =
111
111
consPaymentTxBody ::
112
112
Set (TxIn StandardCrypto ) ->
113
113
Set (TxIn StandardCrypto ) ->
114
- StrictSeq (AlonzoTxOut StandardAlonzo ) ->
114
+ StrictSeq (AlonzoTxOut AlonzoEra ) ->
115
115
Coin ->
116
116
MultiAsset StandardCrypto ->
117
- AlonzoTxBody StandardAlonzo
117
+ AlonzoTxBody AlonzoEra
118
118
consPaymentTxBody ins cols outs fees minted = consTxBody ins cols outs fees minted mempty (Withdrawals mempty )
119
119
120
- consCertTxBody :: [ShelleyTxCert StandardAlonzo ] -> Withdrawals StandardCrypto -> AlonzoTxBody StandardAlonzo
120
+ consCertTxBody :: [ShelleyTxCert AlonzoEra ] -> Withdrawals StandardCrypto -> AlonzoTxBody AlonzoEra
121
121
consCertTxBody = consTxBody mempty mempty mempty (Coin 0 ) mempty
122
122
123
123
mkPaymentTx ::
@@ -126,7 +126,7 @@ mkPaymentTx ::
126
126
Integer ->
127
127
Integer ->
128
128
AlonzoLedgerState ->
129
- Either ForgingError (AlonzoTx StandardAlonzo )
129
+ Either ForgingError (AlonzoTx AlonzoEra )
130
130
mkPaymentTx inputIndex outputIndex amount fees sta = do
131
131
(inputPair, _) <- resolveUTxOIndex inputIndex sta
132
132
addr <- resolveAddress outputIndex sta
@@ -141,7 +141,7 @@ mkPaymentTx' ::
141
141
AlonzoUTxOIndex ->
142
142
[(AlonzoUTxOIndex , MaryValue StandardCrypto )] ->
143
143
AlonzoLedgerState ->
144
- Either ForgingError (AlonzoTx StandardAlonzo )
144
+ Either ForgingError (AlonzoTx AlonzoEra )
145
145
mkPaymentTx' inputIndex outputIndex sta = do
146
146
inputPair <- fst <$> resolveUTxOIndex inputIndex sta
147
147
outps <- mapM mkOuts outputIndex
@@ -162,7 +162,7 @@ mkLockByScriptTx ::
162
162
Integer ->
163
163
Integer ->
164
164
AlonzoLedgerState ->
165
- Either ForgingError (AlonzoTx StandardAlonzo )
165
+ Either ForgingError (AlonzoTx AlonzoEra )
166
166
mkLockByScriptTx inputIndex spendable amount fees sta = do
167
167
(inputPair, _) <- resolveUTxOIndex inputIndex sta
168
168
@@ -173,7 +173,7 @@ mkLockByScriptTx inputIndex spendable amount fees sta = do
173
173
-- No witnesses are necessary when the outputs is a script address. Only when it's consumed.
174
174
Right $ mkSimpleTx True $ consPaymentTxBody input mempty (StrictSeq. fromList $ outs <> [change]) (Coin fees) mempty
175
175
where
176
- datahash = hashData @ StandardAlonzo plutusDataList
176
+ datahash = hashData @ AlonzoEra plutusDataList
177
177
mkOut sp =
178
178
let outAddress = if sp then alwaysSucceedsScriptAddr else alwaysFailsScriptAddr
179
179
in AlonzoTxOut outAddress (valueFromList (Coin amount) [] ) (Strict. SJust datahash)
@@ -186,7 +186,7 @@ mkUnlockScriptTx ::
186
186
Integer ->
187
187
Integer ->
188
188
AlonzoLedgerState ->
189
- Either ForgingError (AlonzoTx StandardAlonzo )
189
+ Either ForgingError (AlonzoTx AlonzoEra )
190
190
mkUnlockScriptTx inputIndex colInputIndex outputIndex succeeds amount fees sta = do
191
191
inputPairs <- fmap fst <$> mapM (`resolveUTxOIndex` sta) inputIndex
192
192
(colInputPair, _) <- resolveUTxOIndex colInputIndex sta
@@ -202,13 +202,13 @@ mkUnlockScriptTx inputIndex colInputIndex outputIndex succeeds amount fees sta =
202
202
$ consPaymentTxBody inpts colInput (StrictSeq. fromList [output]) (Coin fees) mempty
203
203
204
204
mkScriptInp' ::
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 ))
207
207
mkScriptInp' = map (second Just ) . mkScriptInp
208
208
209
209
mkScriptInp ::
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 ))
212
212
mkScriptInp (n, (_txIn, txOut))
213
213
| addr == alwaysFailsScriptAddr =
214
214
Just
@@ -252,7 +252,7 @@ mkMAssetsScriptTx ::
252
252
Bool ->
253
253
Integer ->
254
254
AlonzoLedgerState ->
255
- Either ForgingError (AlonzoTx StandardAlonzo )
255
+ Either ForgingError (AlonzoTx AlonzoEra )
256
256
mkMAssetsScriptTx inputIndex colInputIndex outputIndex minted succeeds fees sta = do
257
257
inputPairs <- fmap fst <$> mapM (`resolveUTxOIndex` sta) inputIndex
258
258
colInput <- Set. singleton . fst . fst <$> resolveUTxOIndex colInputIndex sta
@@ -269,18 +269,18 @@ mkMAssetsScriptTx inputIndex colInputIndex outputIndex minted succeeds fees sta
269
269
where
270
270
mkOuts (outIx, vl) = do
271
271
addr <- resolveAddress outIx sta
272
- Right $ AlonzoTxOut addr vl (Strict. SJust (hashData @ StandardAlonzo plutusDataList))
272
+ Right $ AlonzoTxOut addr vl (Strict. SJust (hashData @ AlonzoEra plutusDataList))
273
273
274
274
mkDCertTx ::
275
- [ShelleyTxCert StandardAlonzo ] ->
275
+ [ShelleyTxCert AlonzoEra ] ->
276
276
Withdrawals StandardCrypto ->
277
- Either ForgingError (AlonzoTx StandardAlonzo )
277
+ Either ForgingError (AlonzoTx AlonzoEra )
278
278
mkDCertTx certs wdrl = Right $ mkSimpleTx True $ consCertTxBody certs wdrl
279
279
280
280
mkSimpleDCertTx ::
281
- [(StakeIndex , StakeCredential StandardCrypto -> ShelleyTxCert StandardAlonzo )] ->
281
+ [(StakeIndex , StakeCredential -> ShelleyTxCert AlonzoEra )] ->
282
282
AlonzoLedgerState ->
283
- Either ForgingError (AlonzoTx StandardAlonzo )
283
+ Either ForgingError (AlonzoTx AlonzoEra )
284
284
mkSimpleDCertTx consDert st = do
285
285
dcerts <- forM consDert $ \ (stakeIndex, mkDCert) -> do
286
286
cred <- resolveStakeCreds stakeIndex st
@@ -290,11 +290,11 @@ mkSimpleDCertTx consDert st = do
290
290
mkDCertPoolTx ::
291
291
[ ( [StakeIndex ]
292
292
, PoolIndex
293
- , [StakeCredential StandardCrypto ] -> KeyHash 'StakePool StandardCrypto -> ShelleyTxCert StandardAlonzo
293
+ , [StakeCredential ] -> KeyHash 'StakePool -> ShelleyTxCert AlonzoEra
294
294
)
295
295
] ->
296
296
AlonzoLedgerState ->
297
- Either ForgingError (AlonzoTx StandardAlonzo )
297
+ Either ForgingError (AlonzoTx AlonzoEra )
298
298
mkDCertPoolTx consDert st = do
299
299
dcerts <- forM consDert $ \ (stakeIxs, poolIx, mkDCert) -> do
300
300
stakeCreds <- forM stakeIxs $ \ stix -> resolveStakeCreds stix st
@@ -303,10 +303,10 @@ mkDCertPoolTx consDert st = do
303
303
mkDCertTx dcerts (Withdrawals mempty )
304
304
305
305
mkScriptDCertTx ::
306
- [(StakeIndex , Bool , StakeCredential StandardCrypto -> ShelleyTxCert StandardAlonzo )] ->
306
+ [(StakeIndex , Bool , StakeCredential -> ShelleyTxCert AlonzoEra )] ->
307
307
Bool ->
308
308
AlonzoLedgerState ->
309
- Either ForgingError (AlonzoTx StandardAlonzo )
309
+ Either ForgingError (AlonzoTx AlonzoEra )
310
310
mkScriptDCertTx consDert valid st = do
311
311
dcerts <- forM consDert $ \ (stakeIndex, _, mkDCert) -> do
312
312
cred <- resolveStakeCreds stakeIndex st
@@ -329,7 +329,7 @@ mkDepositTxPools ::
329
329
AlonzoUTxOIndex ->
330
330
Integer ->
331
331
AlonzoLedgerState ->
332
- Either ForgingError (AlonzoTx StandardAlonzo )
332
+ Either ForgingError (AlonzoTx AlonzoEra )
333
333
mkDepositTxPools inputIndex deposit sta = do
334
334
(inputPair, _) <- resolveUTxOIndex inputIndex sta
335
335
@@ -340,10 +340,10 @@ mkDepositTxPools inputIndex deposit sta = do
340
340
341
341
mkDCertTxPools ::
342
342
AlonzoLedgerState ->
343
- Either ForgingError (AlonzoTx StandardAlonzo )
343
+ Either ForgingError (AlonzoTx AlonzoEra )
344
344
mkDCertTxPools sta = Right $ mkSimpleTx True $ consCertTxBody (allPoolStakeCert sta) (Withdrawals mempty )
345
345
346
- mkSimpleTx :: Bool -> AlonzoTxBody StandardAlonzo -> AlonzoTx StandardAlonzo
346
+ mkSimpleTx :: Bool -> AlonzoTxBody AlonzoEra -> AlonzoTx AlonzoEra
347
347
mkSimpleTx valid txBody =
348
348
AlonzoTx
349
349
{ body = txBody
@@ -353,9 +353,9 @@ mkSimpleTx valid txBody =
353
353
}
354
354
355
355
consPoolParamsTwoOwners ::
356
- [StakeCredential StandardCrypto ] ->
357
- KeyHash 'StakePool StandardCrypto ->
358
- ShelleyTxCert StandardAlonzo
356
+ [StakeCredential ] ->
357
+ KeyHash 'StakePool ->
358
+ ShelleyTxCert AlonzoEra
359
359
consPoolParamsTwoOwners [rwCred, KeyHashObj owner0, KeyHashObj owner1] poolId =
360
360
ShelleyTxCertPool $ RegPool $ consPoolParams poolId rwCred [owner0, owner1]
361
361
consPoolParamsTwoOwners _ _ = panic " expected 2 pool owners"
@@ -417,7 +417,7 @@ mkUTxOAlonzo tx =
417
417
transId = txIdTx tx
418
418
outputsL = Core. bodyTxL . Core. outputsTxBodyL
419
419
420
- emptyTxBody :: AlonzoTxBody StandardAlonzo
420
+ emptyTxBody :: AlonzoTxBody AlonzoEra
421
421
emptyTxBody =
422
422
AlonzoTxBody
423
423
mempty
@@ -434,7 +434,7 @@ emptyTxBody =
434
434
Strict. SNothing
435
435
(Strict. SJust Testnet )
436
436
437
- emptyTx :: AlonzoTx StandardAlonzo
437
+ emptyTx :: AlonzoTx AlonzoEra
438
438
emptyTx =
439
439
AlonzoTx
440
440
{ body = emptyTxBody
0 commit comments