cardano-ledger-api-1.9.1.0: Public API for the cardano ledger codebase
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Api.Scripts.ExUnits

Synopsis

Documentation

data TransactionScriptFailure era Source #

Script failures that can be returned by evalTxExUnitsWithLogs.

Constructors

RedeemerPointsToUnknownScriptHash !(PlutusPurpose AsIx era)

A redeemer was supplied which points to a script hash which we cannot connect to a Plutus script.

MissingScript

Missing redeemer.

Fields

MissingDatum !(DataHash (EraCrypto era))

Missing datum.

ValidationFailure

Plutus evaluation error, for any version

Fields

UnknownTxIn !(TxIn (EraCrypto era))

A redeemer points to a transaction input which is not present in the current UTxO.

InvalidTxIn !(TxIn (EraCrypto era))

A redeemer points to a transaction input which is not plutus locked.

IncompatibleBudget !ExBudget

The execution budget that was calculated by the Plutus evaluator is out of bounds.

NoCostModelInLedgerState !Language

There was no cost model for a given version of Plutus in the ledger state

evalTxExUnits Source #

Arguments

∷ ∀ era. (AlonzoEraTx era, EraUTxO era, EraPlutusContext era, ScriptsNeeded era ~ AlonzoScriptsNeeded era) 
PParams era 
Tx era

The transaction.

UTxO era

The current UTxO set (or the relevant portion for the transaction).

EpochInfo (Either Text)

The epoch info, used to translate slots to POSIX time for plutus.

SystemStart

The start time of the given block chain.

Either (ContextError era) (RedeemerReport era)

We return a map from redeemer pointers to either a failure or a sufficient execution budget. Otherwise, we return a TranslationError manifesting from failed attempts to construct a valid execution context for the given transaction.

Evaluate the execution budgets needed for all the redeemers in a given transaction. If a redeemer is invalid, a failure is returned instead.

The execution budgets in the supplied transaction are completely ignored. The results of evalTxExUnitsWithLogs are intended to replace them.

evalTxExUnitsWithLogs Source #

Arguments

∷ ∀ era. (AlonzoEraTx era, EraUTxO era, EraPlutusContext era, ScriptsNeeded era ~ AlonzoScriptsNeeded era) 
PParams era 
Tx era

The transaction.

UTxO era

The current UTxO set (or the relevant portion for the transaction).

EpochInfo (Either Text)

The epoch info, used to translate slots to POSIX time for plutus.

SystemStart

The start time of the given block chain.

Either (ContextError era) (RedeemerReportWithLogs era)

We return a map from redeemer pointers to either a failure or a sufficient execution budget with logs of the script. Otherwise, we return a TranslationError manifesting from failed attempts to construct a valid execution context for the given transaction.

Unlike evalTxExUnits, this function also returns evaluation logs, useful for debugging.

Evaluate the execution budgets needed for all the redeemers in a given transaction. If a redeemer is invalid, a failure is returned instead.

The execution budgets in the supplied transaction are completely ignored. The results of evalTxExUnitsWithLogs are intended to replace them.