Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- evalPlutusScripts ∷ [PlutusWithContext c] → ScriptResult c
- evalPlutusScriptsWithLogs ∷ [PlutusWithContext c] → ([Text], ScriptResult c)
- data CollectError era
- = NoRedeemer !(PlutusPurpose AsItem era)
- | NoWitness !(ScriptHash (EraCrypto era))
- | NoCostModel !Language
- | BadTranslation !(ContextError era)
- collectPlutusScriptsWithContext ∷ ∀ era. (AlonzoEraTxBody era, AlonzoEraTxWits era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, EraPlutusContext era) ⇒ EpochInfo (Either Text) → SystemStart → PParams era → Tx era → UTxO era → Either [CollectError era] [PlutusWithContext (EraCrypto era)]
- data TransactionScriptFailure era
- = RedeemerPointsToUnknownScriptHash !(PlutusPurpose AsIx era)
- | MissingScript !(PlutusPurpose AsIx era) !(Map (PlutusPurpose AsIx era) (PlutusPurpose AsItem era, Maybe (PlutusScript era), ScriptHash (EraCrypto era)))
- | MissingDatum !(DataHash (EraCrypto era))
- | ValidationFailure !ExUnits !EvaluationError ![Text] !(PlutusWithContext (EraCrypto era))
- | UnknownTxIn !(TxIn (EraCrypto era))
- | InvalidTxIn !(TxIn (EraCrypto era))
- | IncompatibleBudget !ExBudget
- | NoCostModelInLedgerState !Language
- | ContextError !(ContextError era)
- evalTxExUnits ∷ ∀ era. (AlonzoEraTx era, EraUTxO era, EraPlutusContext era, ScriptsNeeded era ~ AlonzoScriptsNeeded era) ⇒ PParams era → Tx era → UTxO era → EpochInfo (Either Text) → SystemStart → RedeemerReport era
- type RedeemerReport era = Map (PlutusPurpose AsIx era) (Either (TransactionScriptFailure era) ExUnits)
- evalTxExUnitsWithLogs ∷ ∀ era. (AlonzoEraTx era, EraUTxO era, EraPlutusContext era, ScriptsNeeded era ~ AlonzoScriptsNeeded era) ⇒ PParams era → Tx era → UTxO era → EpochInfo (Either Text) → SystemStart → RedeemerReportWithLogs era
- type RedeemerReportWithLogs era = Map (PlutusPurpose AsIx era) (Either (TransactionScriptFailure era) ([Text], ExUnits))
Documentation
evalPlutusScripts ∷ [PlutusWithContext c] → ScriptResult c Source #
Evaluate a list of Plutus scripts. All scripts in the list must evaluate to True
.
evalPlutusScriptsWithLogs ∷ [PlutusWithContext c] → ([Text], ScriptResult c) Source #
data CollectError era Source #
When collecting inputs for two phase scripts, 3 things can go wrong.
NoRedeemer !(PlutusPurpose AsItem era) | |
NoWitness !(ScriptHash (EraCrypto era)) | |
NoCostModel !Language | |
BadTranslation !(ContextError era) |
Instances
collectPlutusScriptsWithContext ∷ ∀ era. (AlonzoEraTxBody era, AlonzoEraTxWits era, AlonzoEraUTxO era, ScriptsNeeded era ~ AlonzoScriptsNeeded era, EraPlutusContext era) ⇒ EpochInfo (Either Text) → SystemStart → PParams era → Tx era → UTxO era → Either [CollectError era] [PlutusWithContext (EraCrypto era)] Source #
Execution units estimation
data TransactionScriptFailure era Source #
Script failures that can be returned by evalTxExUnitsWithLogs
.
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. |
| |
MissingDatum !(DataHash (EraCrypto era)) | Missing datum. |
ValidationFailure | Plutus evaluation error, for any version |
| |
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 |
ContextError !(ContextError era) | Error that can happen during plutus context translation |
Instances
(Era era, Show (TxCert era), Show (ContextError era), Show (PlutusScript era), Show (PlutusPurpose AsIx era), Show (PlutusPurpose AsItem era)) ⇒ Show (TransactionScriptFailure era) Source # | |
Defined in Cardano.Ledger.Alonzo.Plutus.Evaluate | |
(Era era, Eq (TxCert era), Eq (PlutusScript era), Eq (ContextError era), Eq (PlutusPurpose AsIx era), Eq (PlutusPurpose AsItem era)) ⇒ Eq (TransactionScriptFailure era) Source # | |
Defined in Cardano.Ledger.Alonzo.Plutus.Evaluate (==) ∷ TransactionScriptFailure era → TransactionScriptFailure era → Bool Source # (/=) ∷ TransactionScriptFailure era → TransactionScriptFailure era → Bool Source # |
∷ ∀ 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. |
→ RedeemerReport era | We return a map from redeemer pointers to either a failure or a sufficient execution budget. |
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.
type RedeemerReport era = Map (PlutusPurpose AsIx era) (Either (TransactionScriptFailure era) ExUnits) Source #
evalTxExUnitsWithLogs Source #
∷ ∀ 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. |
→ 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 Unlike |
Evaluate the execution budgets needed for all the redeemers in a given transaction.
The execution budgets in the supplied transaction are completely ignored.
The results of evalTxExUnitsWithLogs
are intended to replace them.
type RedeemerReportWithLogs era = Map (PlutusPurpose AsIx era) (Either (TransactionScriptFailure era) ([Text], ExUnits)) Source #