File tree Expand file tree Collapse file tree 1 file changed +20
-14
lines changed
cardano-cli/src/Cardano/CLI/EraBased/Transaction Expand file tree Collapse file tree 1 file changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -1715,29 +1715,35 @@ runTransactionCalculatePlutusScriptCostCmd
1715
1715
EraMismatch {ledgerEraName = docToText $ pretty nodeEra, otherEraName = docToText $ pretty txEra}
1716
1716
)
1717
1717
1718
- calculatePlutusScriptsCosts
1719
- (convert txEra)
1720
- systemStart
1721
- eraHistory
1722
- pparams
1723
- txEraUtxo
1724
- tx
1718
+ caseByronOrShelleyBasedEra
1719
+ (left $ TxCmdAlonzoEraOnwardsRequired nodeEra)
1720
+ ( caseShelleyToMaryOrAlonzoEraOnwards
1721
+ (\ _ -> left $ TxCmdAlonzoEraOnwardsRequired nodeEra)
1722
+ ( \ aeo ->
1723
+ calculatePlutusScriptsCosts
1724
+ aeo
1725
+ systemStart
1726
+ eraHistory
1727
+ pparams
1728
+ txEraUtxo
1729
+ tx
1730
+ )
1731
+ )
1732
+ nodeEra
1725
1733
where
1726
1734
calculatePlutusScriptsCosts
1727
1735
:: forall era
1728
- . CardanoEra era
1736
+ . AlonzoEraOnwards era
1729
1737
-> SystemStart
1730
1738
-> EraHistory
1731
1739
-> LedgerProtocolParameters era
1732
1740
-> UTxO era
1733
1741
-> Tx era
1734
1742
-> ExceptT TxCmdError IO ()
1735
- calculatePlutusScriptsCosts era' systemStart eraHistory pparams txEraUtxo tx = do
1736
- scriptHashes <-
1737
- monoidForEraInEon @ AlonzoEraOnwards
1738
- era'
1739
- (\ aeo -> pure $ collectPlutusScriptHashes aeo tx txEraUtxo)
1740
- & hoistMaybe (TxCmdAlonzoEraOnwardsRequired era')
1743
+ calculatePlutusScriptsCosts aeo systemStart eraHistory pparams txEraUtxo tx = do
1744
+ let era' :: CardanoEra era = toCardanoEra aeo
1745
+
1746
+ let scriptHashes = collectPlutusScriptHashes aeo tx txEraUtxo
1741
1747
1742
1748
executionUnitPrices <-
1743
1749
pure (getExecutionUnitPrices era' pparams) & onNothing (left TxCmdPParamExecutionUnitsNotAvailable )
You can’t perform that action at this time.
0 commit comments