@@ -31,24 +31,7 @@ import qualified Cardano.Ledger.Babbage.TxInfo as Babbage
3131import Cardano.Ledger.BaseTypes (Inject (.. ), ProtVer (.. ), strictMaybe )
3232import Cardano.Ledger.Coin (Coin (.. ))
3333import Cardano.Ledger.Conway.Scripts (ConwayPlutusPurpose (.. ))
34- import Cardano.Ledger.Conway.TxInfo (
35- ConwayContextError (.. ),
36- ConwayEraPlutusTxInfo (.. ),
37- guardConwayFeaturesForPlutusV1V2 ,
38- scriptPurposeToScriptInfo ,
39- toPlutusV3Args ,
40- transMintValue ,
41- transProposal ,
42- transTxBodyId ,
43- transTxBodyWithdrawals ,
44- transTxCert ,
45- transTxCertV1V2 ,
46- transTxInInfoV1 ,
47- transTxInInfoV3 ,
48- transTxOutV1 ,
49- transValidityInterval ,
50- transVotingProcedures ,
51- )
34+ import Cardano.Ledger.Conway.TxInfo (ConwayContextError (.. ), ConwayEraPlutusTxInfo (.. ))
5235import qualified Cardano.Ledger.Conway.TxInfo as Conway
5336import Cardano.Ledger.Dijkstra.Core
5437import Cardano.Ledger.Dijkstra.Era (DijkstraEra )
@@ -152,19 +135,19 @@ transPlutusPurposeV3 pv = \case
152135 Left $ inject $ PlutusPurposeNotSupported @ era . hoistPlutusPurpose @ era toAsItem $ inject purpose
153136
154137instance EraPlutusTxInfo 'PlutusV1 DijkstraEra where
155- toPlutusTxCert _ _ = transTxCertV1V2
138+ toPlutusTxCert _ _ = Conway. transTxCertV1V2
156139
157140 toPlutusScriptPurpose proxy pv =
158141 transPlutusPurposeV1V2 proxy pv . hoistPlutusPurpose toAsItem
159142
160143 toPlutusTxInfo proxy LedgerTxInfo {ltiProtVer, ltiEpochInfo, ltiSystemStart, ltiUTxO, ltiTx} = do
161- guardConwayFeaturesForPlutusV1V2 ltiTx
162- timeRange <- transValidityInterval ltiTx ltiEpochInfo ltiSystemStart (txBody ^. vldtTxBodyL)
163- inputs <- mapM (transTxInInfoV1 ltiUTxO) (Set. toList (txBody ^. inputsTxBodyL))
164- mapM_ (transTxInInfoV1 ltiUTxO) (Set. toList (txBody ^. referenceInputsTxBodyL))
144+ Conway. guardConwayFeaturesForPlutusV1V2 ltiTx
145+ timeRange <- Conway. transValidityInterval ltiTx ltiEpochInfo ltiSystemStart (txBody ^. vldtTxBodyL)
146+ inputs <- mapM (Conway. transTxInInfoV1 ltiUTxO) (Set. toList (txBody ^. inputsTxBodyL))
147+ mapM_ (Conway. transTxInInfoV1 ltiUTxO) (Set. toList (txBody ^. referenceInputsTxBodyL))
165148 outputs <-
166149 zipWithM
167- (transTxOutV1 . TxOutFromOutput )
150+ (Conway. transTxOutV1 . TxOutFromOutput )
168151 [minBound .. ]
169152 (F. toList (txBody ^. outputsTxBodyL))
170153 txCerts <- Alonzo. transTxBodyCerts proxy ltiProtVer txBody
@@ -187,14 +170,14 @@ instance EraPlutusTxInfo 'PlutusV1 DijkstraEra where
187170 toPlutusArgs = Alonzo. toPlutusV1Args
188171
189172instance EraPlutusTxInfo 'PlutusV2 DijkstraEra where
190- toPlutusTxCert _ _ = transTxCertV1V2
173+ toPlutusTxCert _ _ = Conway. transTxCertV1V2
191174
192175 toPlutusScriptPurpose proxy pv = transPlutusPurposeV1V2 proxy pv . hoistPlutusPurpose toAsItem
193176
194177 toPlutusTxInfo proxy LedgerTxInfo {ltiProtVer, ltiEpochInfo, ltiSystemStart, ltiUTxO, ltiTx} = do
195- guardConwayFeaturesForPlutusV1V2 ltiTx
178+ Conway. guardConwayFeaturesForPlutusV1V2 ltiTx
196179 timeRange <-
197- transValidityInterval ltiTx ltiEpochInfo ltiSystemStart (txBody ^. vldtTxBodyL)
180+ Conway. transValidityInterval ltiTx ltiEpochInfo ltiSystemStart (txBody ^. vldtTxBodyL)
198181 inputs <- mapM (Babbage. transTxInInfoV2 ltiUTxO) (Set. toList (txBody ^. inputsTxBodyL))
199182 refInputs <- mapM (Babbage. transTxInInfoV2 ltiUTxO) (Set. toList (txBody ^. referenceInputsTxBodyL))
200183 outputs <-
@@ -225,18 +208,18 @@ instance EraPlutusTxInfo 'PlutusV2 DijkstraEra where
225208 toPlutusArgs = Babbage. toPlutusV2Args
226209
227210instance EraPlutusTxInfo 'PlutusV3 DijkstraEra where
228- toPlutusTxCert _ pv = pure . transTxCert pv
211+ toPlutusTxCert _ pv = pure . Conway. transTxCert pv
229212
230213 toPlutusScriptPurpose _ = transPlutusPurposeV3
231214
232215 toPlutusTxInfo proxy LedgerTxInfo {ltiProtVer, ltiEpochInfo, ltiSystemStart, ltiUTxO, ltiTx} = do
233216 timeRange <-
234- transValidityInterval ltiTx ltiEpochInfo ltiSystemStart (txBody ^. vldtTxBodyL)
217+ Conway. transValidityInterval ltiTx ltiEpochInfo ltiSystemStart (txBody ^. vldtTxBodyL)
235218 let
236219 txInputs = txBody ^. inputsTxBodyL
237220 refInputs = txBody ^. referenceInputsTxBodyL
238- inputsInfo <- mapM (transTxInInfoV3 ltiUTxO) (Set. toList txInputs)
239- refInputsInfo <- mapM (transTxInInfoV3 ltiUTxO) (Set. toList refInputs)
221+ inputsInfo <- mapM (Conway. transTxInInfoV3 ltiUTxO) (Set. toList txInputs)
222+ refInputsInfo <- mapM (Conway. transTxInInfoV3 ltiUTxO) (Set. toList refInputs)
240223 let
241224 commonInputs = txInputs `Set.intersection` refInputs
242225 case toList commonInputs of
@@ -255,17 +238,17 @@ instance EraPlutusTxInfo 'PlutusV3 DijkstraEra where
255238 , PV3. txInfoOutputs = outputs
256239 , PV3. txInfoReferenceInputs = refInputsInfo
257240 , PV3. txInfoFee = transCoinToLovelace (txBody ^. feeTxBodyL)
258- , PV3. txInfoMint = transMintValue (txBody ^. mintTxBodyL)
241+ , PV3. txInfoMint = Conway. transMintValue (txBody ^. mintTxBodyL)
259242 , PV3. txInfoTxCerts = txCerts
260- , PV3. txInfoWdrl = transTxBodyWithdrawals txBody
243+ , PV3. txInfoWdrl = Conway. transTxBodyWithdrawals txBody
261244 , PV3. txInfoValidRange = timeRange
262245 , PV3. txInfoSignatories = Alonzo. transTxBodyReqSignerHashes txBody
263246 , PV3. txInfoRedeemers = plutusRedeemers
264247 , PV3. txInfoData = PV3. unsafeFromList $ Alonzo. transTxWitsDatums (ltiTx ^. witsTxL)
265- , PV3. txInfoId = transTxBodyId txBody
266- , PV3. txInfoVotes = transVotingProcedures (txBody ^. votingProceduresTxBodyL)
248+ , PV3. txInfoId = Conway. transTxBodyId txBody
249+ , PV3. txInfoVotes = Conway. transVotingProcedures (txBody ^. votingProceduresTxBodyL)
267250 , PV3. txInfoProposalProcedures =
268- map (transProposal proxy) $ toList (txBody ^. proposalProceduresTxBodyL)
251+ map (Conway. transProposal proxy) $ toList (txBody ^. proposalProceduresTxBodyL)
269252 , PV3. txInfoCurrentTreasuryAmount =
270253 strictMaybe Nothing (Just . transCoinToLovelace) $ txBody ^. currentTreasuryValueTxBodyL
271254 , PV3. txInfoTreasuryDonation =
@@ -276,7 +259,7 @@ instance EraPlutusTxInfo 'PlutusV3 DijkstraEra where
276259 where
277260 txBody = ltiTx ^. bodyTxL
278261
279- toPlutusArgs = toPlutusV3Args
262+ toPlutusArgs = Conway. toPlutusV3Args
280263
281264instance ConwayEraPlutusTxInfo 'PlutusV3 DijkstraEra where
282265 toPlutusChangedParameters _ x = PV3. ChangedParameters (PV3. dataToBuiltinData (toPlutusData x))
@@ -285,18 +268,18 @@ instance ConwayEraPlutusTxInfo 'PlutusV4 DijkstraEra where
285268 toPlutusChangedParameters _ x = PV3. ChangedParameters (PV3. dataToBuiltinData (toPlutusData x))
286269
287270instance EraPlutusTxInfo 'PlutusV4 DijkstraEra where
288- toPlutusTxCert _ pv = pure . transTxCert pv
271+ toPlutusTxCert _ pv = pure . Conway. transTxCert pv
289272
290273 toPlutusScriptPurpose _ = error " stub: PlutusV4 not yet implemented"
291274
292275 toPlutusTxInfo proxy LedgerTxInfo {ltiProtVer, ltiEpochInfo, ltiSystemStart, ltiUTxO, ltiTx} = do
293276 timeRange <-
294- transValidityInterval ltiTx ltiEpochInfo ltiSystemStart (txBody ^. vldtTxBodyL)
277+ Conway. transValidityInterval ltiTx ltiEpochInfo ltiSystemStart (txBody ^. vldtTxBodyL)
295278 let
296279 txInputs = txBody ^. inputsTxBodyL
297280 refInputs = txBody ^. referenceInputsTxBodyL
298- inputsInfo <- mapM (transTxInInfoV3 ltiUTxO) (Set. toList txInputs)
299- refInputsInfo <- mapM (transTxInInfoV3 ltiUTxO) (Set. toList refInputs)
281+ inputsInfo <- mapM (Conway. transTxInInfoV3 ltiUTxO) (Set. toList txInputs)
282+ refInputsInfo <- mapM (Conway. transTxInInfoV3 ltiUTxO) (Set. toList refInputs)
300283 let
301284 commonInputs = txInputs `Set.intersection` refInputs
302285 case toList commonInputs of
@@ -315,17 +298,17 @@ instance EraPlutusTxInfo 'PlutusV4 DijkstraEra where
315298 , PV3. txInfoOutputs = outputs
316299 , PV3. txInfoReferenceInputs = refInputsInfo
317300 , PV3. txInfoFee = transCoinToLovelace (txBody ^. feeTxBodyL)
318- , PV3. txInfoMint = transMintValue (txBody ^. mintTxBodyL)
301+ , PV3. txInfoMint = Conway. transMintValue (txBody ^. mintTxBodyL)
319302 , PV3. txInfoTxCerts = txCerts
320- , PV3. txInfoWdrl = transTxBodyWithdrawals txBody
303+ , PV3. txInfoWdrl = Conway. transTxBodyWithdrawals txBody
321304 , PV3. txInfoValidRange = timeRange
322305 , PV3. txInfoSignatories = Alonzo. transTxBodyReqSignerHashes txBody
323306 , PV3. txInfoRedeemers = plutusRedeemers
324307 , PV3. txInfoData = PV3. unsafeFromList $ Alonzo. transTxWitsDatums (ltiTx ^. witsTxL)
325- , PV3. txInfoId = transTxBodyId txBody
326- , PV3. txInfoVotes = transVotingProcedures (txBody ^. votingProceduresTxBodyL)
308+ , PV3. txInfoId = Conway. transTxBodyId txBody
309+ , PV3. txInfoVotes = Conway. transVotingProcedures (txBody ^. votingProceduresTxBodyL)
327310 , PV3. txInfoProposalProcedures =
328- map (transProposal proxy) $ toList (txBody ^. proposalProceduresTxBodyL)
311+ map (Conway. transProposal proxy) $ toList (txBody ^. proposalProceduresTxBodyL)
329312 , PV3. txInfoCurrentTreasuryAmount =
330313 strictMaybe Nothing (Just . transCoinToLovelace) $ txBody ^. currentTreasuryValueTxBodyL
331314 , PV3. txInfoTreasuryDonation =
@@ -350,9 +333,7 @@ toPlutusV4Args ::
350333toPlutusV4Args proxy pv txInfo plutusPurpose maybeSpendingData redeemerData = do
351334 scriptPurpose <- toPlutusScriptPurpose proxy pv plutusPurpose
352335 let scriptInfo =
353- scriptPurposeToScriptInfo
354- scriptPurpose
355- (transDatum <$> maybeSpendingData)
336+ Conway. scriptPurposeToScriptInfo scriptPurpose (transDatum <$> maybeSpendingData)
356337 pure $
357338 PlutusV4Args $
358339 PV3. ScriptContext
0 commit comments