| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cardano.Ledger.Plutus.Evaluate
Synopsis
- data PlutusWithContext where
- PlutusWithContext ∷ PlutusLanguage l ⇒ {..} → PlutusWithContext
- data ScriptFailure = ScriptFailure {}
- data ScriptResult
- scriptPass ∷ PlutusWithContext → ScriptResult
- scriptFail ∷ ScriptFailure → ScriptResult
- data PlutusDebugInfo
- data PlutusDebugOverrides = PlutusDebugOverrides {
- pdoScript ∷ !(Maybe ByteString)
- pdoProtocolVersion ∷ !(Maybe Version)
- pdoLanguage ∷ !(Maybe Language)
- pdoCostModelValues ∷ !(Maybe [Int64])
- pdoExUnitsMem ∷ !(Maybe Natural)
- pdoExUnitsSteps ∷ !(Maybe Natural)
- pdoExUnitsEnforced ∷ !Bool
- defaultPlutusDebugOverrides ∷ PlutusDebugOverrides
- debugPlutus ∷ HasCallStack ⇒ String → Int → PlutusDebugOverrides → IO PlutusDebugInfo
- debugPlutusUnbounded ∷ HasCallStack ⇒ String → PlutusDebugOverrides → PlutusDebugInfo
- runPlutusScript ∷ PlutusWithContext → ScriptResult
- runPlutusScriptWithLogs ∷ PlutusWithContext → ([Text], ScriptResult)
- evaluatePlutusWithContext ∷ VerboseMode → PlutusWithContext → ([Text], Either EvaluationError ExBudget)
- explainPlutusEvaluationError ∷ PlutusWithContext → EvaluationError → ScriptResult
Documentation
data PlutusWithContext where Source #
This type contains all that is necessary from Ledger to evaluate a plutus script.
Constructors
| PlutusWithContext | |
Fields
| |
Instances
| Show PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods showsPrec ∷ Int → PlutusWithContext → ShowS # show ∷ PlutusWithContext → String # showList ∷ [PlutusWithContext] → ShowS # | |
| FromCBOR PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate | |
| ToCBOR PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods toCBOR ∷ PlutusWithContext → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy PlutusWithContext → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [PlutusWithContext] → Size Source # | |
| NFData PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods rnf ∷ PlutusWithContext → () # | |
| Eq PlutusWithContext Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods | |
data ScriptFailure Source #
Constructors
| ScriptFailure | |
Instances
| Generic ScriptFailure Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Associated Types type Rep ScriptFailure ∷ Type → Type # | |
| Show ScriptFailure Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods showsPrec ∷ Int → ScriptFailure → ShowS # show ∷ ScriptFailure → String # showList ∷ [ScriptFailure] → ShowS # | |
| type Rep ScriptFailure Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate type Rep ScriptFailure = D1 ('MetaData "ScriptFailure" "Cardano.Ledger.Plutus.Evaluate" "cardano-ledger-core-1.19.0.0-inplace" 'False) (C1 ('MetaCons "ScriptFailure" 'PrefixI 'True) (S1 ('MetaSel ('Just "scriptFailureMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "scriptFailurePlutus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PlutusWithContext))) | |
data ScriptResult Source #
Constructors
| Passes [PlutusWithContext] | |
| Fails [PlutusWithContext] (NonEmpty ScriptFailure) |
Instances
data PlutusDebugInfo Source #
Constructors
| DebugBadHex String | |
| DebugCannotDecode String | |
| DebugSuccess | |
| DebugFailure | |
Fields
| |
| DebugTimedOut | Script did not terminate within the imposed limit |
Fields
| |
Instances
| Show PlutusDebugInfo Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods showsPrec ∷ Int → PlutusDebugInfo → ShowS # show ∷ PlutusDebugInfo → String # showList ∷ [PlutusDebugInfo] → ShowS # | |
| NFData PlutusDebugInfo Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods rnf ∷ PlutusDebugInfo → () # | |
data PlutusDebugOverrides Source #
Various overrides that can be supplied to plutusDebug and plutusDebugUnbouded
Constructors
| PlutusDebugOverrides | |
Fields
| |
Instances
| Show PlutusDebugOverrides Source # | |
Defined in Cardano.Ledger.Plutus.Evaluate Methods showsPrec ∷ Int → PlutusDebugOverrides → ShowS # show ∷ PlutusDebugOverrides → String # showList ∷ [PlutusDebugOverrides] → ShowS # | |
debugPlutus ∷ HasCallStack ⇒ String → Int → PlutusDebugOverrides → IO PlutusDebugInfo Source #
Execute a hex encoded script with the context that was produced within the ledger predicate
failure. Using PlutusDebugOverrides it is possible to override any part of the execution.
debugPlutusUnbounded ∷ HasCallStack ⇒ String → PlutusDebugOverrides → PlutusDebugInfo Source #
This is just like debugPlutus, except it is pure and if a supplied script contains an
infinite loop or a very expensive computation, it might not terminate within a reasonable
timeframe.
evaluatePlutusWithContext ∷ VerboseMode → PlutusWithContext → ([Text], Either EvaluationError ExBudget) Source #
explainPlutusEvaluationError ∷ PlutusWithContext → EvaluationError → ScriptResult Source #
Explain why a script might fail. Scripts come in three flavors:
- with 3 arguments
[data,redeemer,context]forPlutusV1andPlustuV2 - with 2 arguments
[redeemer,context]forPlutusV1andPlustuV2 - with 1 argument
contextforPlutusV3onwards