cardano-ledger-alonzo-0.1.0.0: Cardano ledger introducing Plutus Core
Safe Haskell None
Language Haskell2010

Cardano.Ledger.Alonzo.Tools

Synopsis

Documentation

evaluateTransactionExecutionUnits Source #

Arguments

:: forall era. ( Era era, ExtendedUTxO era, HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "txdats" ( Witnesses era) ( TxDats era), HasField "txrdmrs" ( Witnesses era) ( Redeemers era), HasField "_maxTxExUnits" ( PParams era) ExUnits , HasField "_protocolVersion" ( PParams era) ProtVer , Script era ~ Script 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.

-> Array Language CostModel

The array of cost models, indexed by the supported languages.

-> Either ( TranslationError ( Crypto era)) (RedeemerReport ( Crypto 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 evaluateTransactionExecutionUnits are intended to replace them.

evaluateTransactionExecutionUnitsWithLogs Source #

Arguments

:: forall era. ( Era era, ExtendedUTxO era, HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "txdats" ( Witnesses era) ( TxDats era), HasField "txrdmrs" ( Witnesses era) ( Redeemers era), HasField "_maxTxExUnits" ( PParams era) ExUnits , HasField "_protocolVersion" ( PParams era) ProtVer , Script era ~ Script 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.

-> Array Language CostModel

The array of cost models, indexed by the supported languages.

-> Either ( TranslationError ( Crypto era)) (RedeemerReportWithLogs ( Crypto 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.

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 evaluateTransactionExecutionUnitsWithLogs are intended to replace them.

data TransactionScriptFailure c Source #

Script failures that can be returned by evaluateTransactionExecutionUnits .

Constructors

RedeemerNotNeeded ! RdmrPtr !( ScriptHash c)

A redeemer was supplied that does not point to a valid plutus evaluation site in the given transaction.

RedeemerPointsToUnknownScriptHash ! RdmrPtr

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

MissingScript ! RdmrPtr !( Map RdmrPtr ( ScriptPurpose c, Maybe ( ShortByteString , Language ), ScriptHash c))

Missing redeemer. The first parameter is the redeemer pointer which cannot be resolved, and the second parameter is the map of pointers which can be resolved.

MissingDatum !( DataHash c)

Missing datum.

ValidationFailedV1 ! EvaluationError ![ Text ]

Plutus V1 evaluation error.

ValidationFailedV2 ! EvaluationError ![ Text ]

Plutus V2 evaluation error.

UnknownTxIn !( TxIn c)

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

InvalidTxIn !( TxIn c)

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