Skip to content

Commit

Permalink
Fees: add a type synonym for logs returned by evalTxExUnitsWithLogs
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Jun 17, 2024
1 parent e881c2d commit b3fc10b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cardano-api/internal/Cardano/Api/Fees.hs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ import Lens.Micro ((.~), (^.))

{- HLINT ignore "Redundant return" -}

-- | Type synonym for logs returned by the ledger's @evalTxExUnitsWithLogs@ function.
-- for scripts in transactions.
type EvalTxExecutionUnitsLog = [Text]

data AutoBalanceError era
= AutoBalanceEstimationError (TxFeeEstimationError era)
| AutoBalanceCalculationError (TxBodyErrorAutoBalance era)
Expand Down Expand Up @@ -619,7 +623,7 @@ evaluateTransactionExecutionUnits :: forall era. ()
-> UTxO era
-> TxBody era
-> Either (TransactionValidityError era)
(Map ScriptWitnessIndex (Either ScriptExecutionError ([Text], ExecutionUnits)))
(Map ScriptWitnessIndex (Either ScriptExecutionError (EvalTxExecutionUnitsLog, ExecutionUnits)))
evaluateTransactionExecutionUnits era systemstart epochInfo pp utxo txbody =
case makeSignedTransaction' era [] txbody of
ShelleyTx sbe tx' -> evaluateTransactionExecutionUnitsShelley sbe systemstart epochInfo pp utxo tx'
Expand All @@ -632,7 +636,7 @@ evaluateTransactionExecutionUnitsShelley :: forall era. ()
-> UTxO era
-> L.Tx (ShelleyLedgerEra era)
-> Either (TransactionValidityError era)
(Map ScriptWitnessIndex (Either ScriptExecutionError ([Text], ExecutionUnits)))
(Map ScriptWitnessIndex (Either ScriptExecutionError (EvalTxExecutionUnitsLog, ExecutionUnits)))
evaluateTransactionExecutionUnitsShelley sbe systemstart epochInfo (LedgerProtocolParameters pp) utxo tx =
caseShelleyToMaryOrAlonzoEraOnwards
(const (Right Map.empty))
Expand Down

0 comments on commit b3fc10b

Please sign in to comment.