Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- evaluateTransactionExecutionUnits :: 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 -> UTxO era -> EpochInfo ( Either Text ) -> SystemStart -> Array Language CostModel -> Either ( TranslationError ( Crypto era)) (RedeemerReport ( Crypto era))
- evaluateTransactionExecutionUnitsWithLogs :: 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 -> UTxO era -> EpochInfo ( Either Text ) -> SystemStart -> Array Language CostModel -> Either ( TranslationError ( Crypto era)) (RedeemerReportWithLogs ( Crypto era))
-
data
TransactionScriptFailure
c
- = RedeemerNotNeeded ! RdmrPtr !( ScriptHash c)
- | RedeemerPointsToUnknownScriptHash ! RdmrPtr
- | MissingScript ! RdmrPtr !( Map RdmrPtr ( ScriptPurpose c, Maybe ( ShortByteString , Language ), ScriptHash c))
- | MissingDatum !( DataHash c)
- | ValidationFailedV1 ! EvaluationError ![ Text ]
- | ValidationFailedV2 ! EvaluationError ![ Text ]
- | UnknownTxIn !( TxIn c)
- | InvalidTxIn !( TxIn c)
- | IncompatibleBudget ! ExBudget
- | NoCostModelInLedgerState ! Language
Documentation
evaluateTransactionExecutionUnits Source #
:: 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
|
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 #
:: 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
|
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
.
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 |
Instances
Eq ( TransactionScriptFailure c) Source # | |
Defined in Cardano.Ledger.Alonzo.Tools (==) :: TransactionScriptFailure c -> TransactionScriptFailure c -> Bool Source # (/=) :: TransactionScriptFailure c -> TransactionScriptFailure c -> Bool Source # |
|
Show ( TransactionScriptFailure c) Source # | |
Defined in Cardano.Ledger.Alonzo.Tools |